summaryrefslogtreecommitdiffstats
path: root/libs/hwui/LayerCache.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add overrides and switch to nullptr keyword for all filesChris Craik2015-01-051-3/+3
| | | | | | | Adds remaining missing overrides and nullptr usages, missed due to an extreme failure in tool usage. Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
* CleanupChris Craik2014-12-221-17/+7
| | | | Change-Id: I91ffb9c66697741116fdeaa31abdf6cfd79155df
* resolved conflicts for merge of 1d03b816 to lmp-mr1-dev-plus-aospAndreas Gampe2014-11-101-7/+17
| | | | | | (cherry picked from commit 1272887050a269d6d506b42099c2857847ad100b) Change-Id: Ib673768fe5fc03615626ef4b10590e5317f22172
* Layer changesJohn Reck2014-10-311-1/+1
| | | | | | | | | | | | Bug: 17208461 * Switch Layer to be VirtualLightRefBase instead of Caches' side-channel ref-counting * Include active layers in gfxinfo dump * Run gfxinfo dump on the correct thread * Dump gfxinfo on Layer creation failure Change-Id: I28d195699e2334518e215ab28c7a17355aee9678
* Additional layer loggingChris Craik2014-09-101-0/+5
| | | | | | | | bug:17208461 Track layer's last known state. Change-Id: Ic1799191f5839a1d6cc56f598f2ac2671dc27a6f
* Don't track TextureLayer lifecycles in RenderStateChris Craik2014-09-081-1/+1
| | | | | | | | | | bug:17208461 They are destroyed via finalizer-enqueued destroy method, so it's not valid to check that they've been destroyed at gl context destruction time. Change-Id: I670f69825547facd5f31d44acb406418881fee00
* Have destroy call freePrefetchedLayersJohn Reck2014-09-031-0/+4
| | | | | | | | | | | | | | | | | | | Bug: 17208461 There's a potential race condition between HardwareRenderer.destroy() being called (which calls destroyCanvasAndSurface()) and the renderer being finalized (which is what calls freePrefetchedLayers), during which time it's possible we get a TRIM_MEMORY_COMPLETE and destroy the EGL context. Fix this race condition by moving stopDrawing() and freePrefetchedLayers() into destroyCanvasAndSurface() where they should have been in the first place. Also, if we hit the assertion failure, dump the current state of Caches to try and provide more context for the failure. Change-Id: Ife0ba3562041e8b08e87e3e13640472b3004eed6
* No-fail invokeFunctorJohn Reck2014-06-231-2/+2
| | | | | | | Bug: 15513308 Bug: 15449247 Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c
* Cancel layer update when a layer is about to be destroyedRomain Guy2013-06-171-3/+1
| | | | | | Bug #9310706 Change-Id: I73eea6314c326f15a979617e3a05b525935f0d3f
* Add a render buffer cache to reuse stencil buffersRomain Guy2013-02-131-1/+0
| | | | | | | | | | Bug #7146141 This new cache is used in a similar way to LayerCache. It helps reuse already allocated stencil buffers and thus avoid churning memory on every frame. Change-Id: I19551d72da52c40039e65904563600e492c8b193
* Allow layers with a stencil buffer to be resized on the flyRomain Guy2013-01-181-25/+0
| | | | | | | | | Bug #7146141 This change moves the resizeLayer() from LayerCache (where it should never have been anyway) to Layer. This makes a little more sense. Change-Id: I8b2f9c19c558e738405a58b9e71ec5799fc6be88
* Add plumbing for better text scalingRomain Guy2013-01-081-0/+8
| | | | | | | | Fonts are now described by a transform matrix. This lead to switching from a vector to a hashmap. This change therefore adds new comparators and hash computations to Font. Change-Id: I2daffa7d6287c18554c606b8bfa06640d28b4530
* Fix occasional crash bug with layersChet Haase2012-09-171-8/+3
| | | | | | | | | | | | | | | | | | | | Launcher occasionally crashes with a stack trace indicating that the memory of a Layer object is corrupt. It is possible for us to delete a Layer structure and then, briefly, use it to draw a DisplayList again before that DisplayList gets recreated (without the layer that got deleted). When this happens, if the memory got corrupted, it's possible to crash. The fix is to add Layer to the other objects which we currently refcount (bitmaps, shaders, etc.). Then instead of deleting a Layer, we decrement the refcount. We increment when creating it, then increment it again when it's referenced from a DisplayList. Then we decrement the refcount instead of deleting it, and decrement when we clear a DisplayList that refers to it. Then when the refcount reaches 0, we delete it. Issue #6994632 Native crash in launcher when trying to launch all apps screen Change-Id: I0627be8d49bb2f9ba8d158a84b764bb4e7df934c
* Prevent crash when flushing the layers cacheRomain Guy2012-04-021-2/+10
| | | | | | | | | | Bug #6258973 When flushing the layer caches we would attempt to delete the FBOs associate with layers in the cache. The FBO property was however not always properly cleared when recycling layers. Change-Id: I7dedfe391d659a0849f1e1d84df17313b2c6e2b2
* Further reduce the number of GL commands sent to the driverRomain Guy2011-12-131-1/+2
| | | | Change-Id: Id922b2a166ea4573b767c27d3195e11c70320b23
* Various OpenGL optimizationsRomain Guy2011-12-121-2/+2
| | | | Change-Id: Ib0742c96f10f5f50e7e5148b742c31b6c232d127
* Move constants to the correct headerRomain Guy2011-08-221-1/+1
| | | | Change-Id: Id4bd14f72487bd7156cd2e1930eaf97b47896273
* Reclaim more memory, more often.Romain Guy2011-07-271-0/+1
| | | | | | Yay. Change-Id: I04557ad575c307a55088549f48f0e9ad994b7275
* Improve layers debuggingRomain Guy2011-07-261-5/+9
| | | | Change-Id: Ia4950dd5f0e0a224ecb69c581d33aa4f32260a7c
* Make sure we have a current EGL context when invoking EGLRomain Guy2011-07-261-0/+1
| | | | | | Bug #5081795 Change-Id: Iee3382d362a71c1e6c5c498b319bf7f7bcf5a2f0
* Improve rendering performance on some GPUsRomain Guy2011-07-251-1/+1
| | | | | | | | This change sets textures filtering to GL_NEAREST by default. GL_LINEAR filtering is only used when textures are transformed with a scale or a rotation. This helps save a couple of fps on some GPUs. Change-Id: I1efaa452c2c79905f00238e54d886a37203a2ac1
* Use NEAREST filtering for layers whenever possible.Romain Guy2011-07-071-28/+22
| | | | Change-Id: Id5bee1bd4a322cf93e8000b08e18f1e1b058648e
* New widget: TextureViewRomain Guy2011-04-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug #4343984 TextureView can be used to render media content (video, OpenGL, RenderScript) inside a View. The key difference with SurfaceView is that TextureView does not create a new Surface. This gives the ability to seamlessly transform, animate, fade, etc. a TextureView, which was hard if not impossible to do with a SurfaceView. A TextureView also interacts perfectly with ScrollView, ListView, etc. It allows application to embed media content in a much more flexible way than before. For instance, to render the camera preview at 50% opacity, all you need to do is the following: mTextureView.setAlpha(0.5f); Camera c = Camera.open(); c.setPreviewTexture(mTextureView.getSurfaceTexture()); c.startPreview(); TextureView uses a SurfaceTexture to get the job done. More APIs are required to make it easy to create OpenGL contexts for a TextureView. It can currently be done with a bit of JNI code. Change-Id: Iaa7953097ab5beb8437bcbbfa03b2df5b7f80cd7
* Allocate layers from the layers pool.Romain Guy2011-02-021-0/+25
| | | | | | | | | | | Bug #3413433 This change will be beneficial to Launcher to avoid hiccups when swiping pages of icons. When a layer is discarded, it is kept in the layers pool instead of being destroyed right away. This favors memory reuse over allocations. Change-Id: Ifb6944ba83d6ceb67c331527c0827b26ce648eb1
* Log only 1 line per process when using OpenGLRenderer.Romain Guy2011-01-211-2/+3
| | | | Change-Id: Idbdd6b84f31301e58ed53e0d50fd61fece192dfa
* New layers API for Views.Romain Guy2011-01-061-0/+1
| | | | | | | | | This API can be used to back a view and its children with either a software layer (bitmap) or hardware layer (FBO). Layers have various usages, including color filtering and performance improvements during animations. Change-Id: Ifc3bea847918042730fc5a8c2d4206dd6c9420a3
* Tweak layers caching for better performance in Launcher.Romain Guy2010-10-121-6/+9
| | | | Change-Id: Ia6e67699d98f69c8a93385b3ecbdd814c7b16921
* Better cache for layers, reduce memory usage and increase framerate.Romain Guy2010-10-081-41/+38
| | | | Change-Id: I5ff864a361db4791bd5ff6be716f7ce692ef572d
* Optimize saveLayer() when the clip flag is set.Romain Guy2010-10-051-3/+13
| | | This speeds up applications, especially Launcher.
* Fix INVALID_OPERATION error with layers rendering.Romain Guy2010-10-011-0/+2
| | | | | | | | This change is a workaround for a driver bug that causes an INVALID_OPERATION to be thrown on every glCopyTexSubImage() call. This change also adds a new test for gradients local matrices. Change-Id: I41b7437481026702d0a3a9677f099b4557c0a84e
* Correctly initialize/refresh layers.Romain Guy2010-09-221-5/+3
| | | | Change-Id: Id8cdcf587b13098460f7d4aa1bd17708784d89bb
* Better error handling in the OpenGL renderer.Romain Guy2010-09-161-2/+0
| | | | | | | Add a glGetError() check on every frame Don't attempt to create textures larger than the maximum size allowed Change-Id: Iee4afae16089406dbe8bf10fc93b674f1271a0ca
* Correct implementation of saveLayer().Romain Guy2010-09-121-23/+1
| | | | Change-Id: I5375126636913e0a84f2d6bbd0ebe40d2e4f2763
* Use only one GL context per process, share chaches.Romain Guy2010-08-241-0/+13
| | | | Change-Id: Ieabaa25338d2f4b8d4fd90e7401ad6e7452eae11
* Optimize textures binding.Romain Guy2010-07-161-1/+0
| | | | | | | The renderer is still changing textures' wrap modes every time, this will require a latter optimization. Change-Id: I3eb92cb8c886c4a692b7f0ca759911f9371d4d2c
* Create FBOs in LayerCache.Romain Guy2010-07-081-1/+47
| | | | | | | This moves a bit of code away from OpenGLRenderer and matches what happens with the TextureCache. Change-Id: I3c67f54f83d7240770daa015861c0e75a1dd8c42
* Simpler way to deal with the FBO multi-cache.Romain Guy2010-07-071-2/+3
| | | | | | | | This change removes the need for the SortedList and instead just add a generated id to each FBO stored in the cache. This is an artificial way to store several FBOs with the same dimensions. Change-Id: I9638364e9bdc0f2391261937a0c86096f20505bf
* Optimize FBO cache.Romain Guy2010-07-071-3/+2
| | | | | | | | | This change introduces a new generational cache called GenerationMultiCache that can store several values with the same key. This can be used to use multiple layers of the same size at the same time, without recreating them over and over again. Change-Id: I425466a20908b862c5f464a0f9e582ec18cbd7ac
* Add a layer (FBO) cache.Romain Guy2010-07-061-0/+114
The cache is used to draw layers so that a new texture does not have to be recreated every time a call to saveLayer() happens. The FBO cache used a KeyedVector, which is a bad idea. The cache should be able to store several FBOs of the same size (this happens a lot during scrolling with fading edges for instance.) This will be changed in a future CL. Change-Id: Ic316189e625f0dbcf0d273a71cc981a433d48726