summaryrefslogtreecommitdiffstats
path: root/libs/hwui/LayerCache.h
Commit message (Collapse)AuthorAgeFilesLines
* Add overrides and switch to nullptr keywordChris Craik2014-12-221-2/+2
| | | | | | | | Changes generated with clang-modernize. Additionally, fixed some struct-vs-class usage to make clang happy. Change-Id: Ic6ef2427401ff1e794d26f21f7b44868fc75fb72
* CleanupChris Craik2014-12-221-3/+6
| | | | Change-Id: I91ffb9c66697741116fdeaa31abdf6cfd79155df
* resolved conflicts for merge of 1d03b816 to lmp-mr1-dev-plus-aospAndreas Gampe2014-11-101-6/+2
| | | | | | (cherry picked from commit 1272887050a269d6d506b42099c2857847ad100b) Change-Id: Ib673768fe5fc03615626ef4b10590e5317f22172
* Have destroy call freePrefetchedLayersJohn Reck2014-09-031-0/+2
| | | | | | | | | | | | | | | | | | | 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-1/+3
| | | | | | | Bug: 15513308 Bug: 15449247 Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c
* Add a render buffer cache to reuse stencil buffersRomain Guy2013-02-131-12/+10
| | | | | | | | | | 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-13/+2
| | | | | | | | | 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-10/+18
| | | | | | | | 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
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-1/+1
| | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
* Move constants to the correct headerRomain Guy2011-08-221-5/+1
| | | | Change-Id: Id4bd14f72487bd7156cd2e1930eaf97b47896273
* Make sure we correctly copy caches keys.Romain Guy2011-08-121-4/+0
| | | | | | Bug #5136067 Change-Id: I366e840bef44415436dc7b13d89cfb610feed663
* Improve layers debuggingRomain Guy2011-07-261-0/+5
| | | | Change-Id: Ia4950dd5f0e0a224ecb69c581d33aa4f32260a7c
* Use NEAREST filtering for layers whenever possible.Romain Guy2011-07-071-1/+1
| | | | Change-Id: Id5bee1bd4a322cf93e8000b08e18f1e1b058648e
* Allocate layers from the layers pool.Romain Guy2011-02-021-0/+11
| | | | | | | | | | | 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
* Move all debug flags in a single place.Romain Guy2010-11-101-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | This change also adds a new memory usage flag. When turned on, the following is printed after every frame: D/OpenGLRenderer( 3723): Current memory usage / total memory usage (bytes): D/OpenGLRenderer( 3723): TextureCache 3766680 / 20971520 D/OpenGLRenderer( 3723): LayerCache 3538944 / 8388608 D/OpenGLRenderer( 3723): GradientCache 135168 / 524288 D/OpenGLRenderer( 3723): PathCache 41180 / 4194304 D/OpenGLRenderer( 3723): TextDropShadowCache 0 / 2097152 D/OpenGLRenderer( 3723): FontRenderer 0 262144 / 262144 D/OpenGLRenderer( 3723): FontRenderer 1 262144 / 262144 D/OpenGLRenderer( 3723): FontRenderer 2 262144 / 262144 D/OpenGLRenderer( 3723): Other: D/OpenGLRenderer( 3723): FboCache 2 / 12 D/OpenGLRenderer( 3723): PatchCache 31 / 512 D/OpenGLRenderer( 3723): Total memory usage: D/OpenGLRenderer( 3723): 8268404 bytes, 7.89 MB This should help tracking possibe memory issues. Change-Id: I83f483ca1d2dbef904829bce368e33fe5503e8d6
* Optimize FBO drawing with regions.Romain Guy2010-11-021-3/+3
| | | | | | | | | This optimization is currently disabled until Launcher is modified to take advantage of it. The optimization can be enabled by turning on RENDER_LAYERS_AS_REGIONS in the OpenGLRenderer.h file. Change-Id: I2fdf59d0f4dc690a3d7f712173ab8db3848b27b1
* Tweak layers caching for better performance in Launcher.Romain Guy2010-10-121-0/+2
| | | | Change-Id: Ia6e67699d98f69c8a93385b3ecbdd814c7b16921
* Better cache for layers, reduce memory usage and increase framerate.Romain Guy2010-10-081-17/+48
| | | | Change-Id: I5ff864a361db4791bd5ff6be716f7ce692ef572d
* Optimize saveLayer() when the clip flag is set.Romain Guy2010-10-051-1/+1
| | | This speeds up applications, especially Launcher.
* Correct implementation of saveLayer().Romain Guy2010-09-121-3/+1
| | | | Change-Id: I5375126636913e0a84f2d6bbd0ebe40d2e4f2763
* Use only one GL context per process, share chaches.Romain Guy2010-08-241-0/+1
| | | | Change-Id: Ieabaa25338d2f4b8d4fd90e7401ad6e7452eae11
* Draw n-patches using OpenGL.Romain Guy2010-07-081-1/+1
| | | | | | Currently only tested with title bars and buttons. Change-Id: I8263a9281898dc0e943b1b8412827fe55639b9d6
* Create FBOs in LayerCache.Romain Guy2010-07-081-2/+32
| | | | | | | 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-1/+2
| | | | | | | | 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-1/+1
| | | | | | | | | 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/+78
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