21 Commits

Author SHA1 Message Date
Romain Guy
8d4aeb7111 Add a render buffer cache to reuse stencil buffers
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
2013-02-13 11:27:05 -08:00
Romain Guy
2055abaa0a Allow layers with a stencil buffer to be resized on the fly
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
2013-01-18 16:42:51 -08:00
Romain Guy
e3a9b24b5e Add plumbing for better text scaling
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
2013-01-08 15:21:42 -08:00
Steve Block
5baa3a62a9 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
2012-01-03 22:38:27 +00:00
Romain Guy
28d8ff6dbc Move constants to the correct header
Change-Id: Id4bd14f72487bd7156cd2e1930eaf97b47896273
2011-08-22 14:01:34 -07:00
Romain Guy
e5df231434 Make sure we correctly copy caches keys.
Bug #5136067

Change-Id: I366e840bef44415436dc7b13d89cfb610feed663
2011-08-12 14:23:53 -07:00
Romain Guy
eea60692b0 Improve layers debugging
Change-Id: Ia4950dd5f0e0a224ecb69c581d33aa4f32260a7c
2011-07-26 20:35:55 -07:00
Romain Guy
9ace8f5e79 Use NEAREST filtering for layers whenever possible.
Change-Id: Id5bee1bd4a322cf93e8000b08e18f1e1b058648e
2011-07-07 20:50:11 -07:00
Romain Guy
09b7c91de7 Allocate layers from the layers pool.
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
2011-02-02 20:28:09 -08:00
Romain Guy
c15008e72e Move all debug flags in a single place.
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
2010-11-10 11:59:15 -08:00
Romain Guy
5b3b35296e Optimize FBO drawing with regions.
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
2010-11-02 16:17:23 -07:00
Romain Guy
e91080581f Tweak layers caching for better performance in Launcher.
Change-Id: Ia6e67699d98f69c8a93385b3ecbdd814c7b16921
2010-10-12 18:15:42 -07:00
Romain Guy
8550c4c7b5 Better cache for layers, reduce memory usage and increase framerate.
Change-Id: I5ff864a361db4791bd5ff6be716f7ce692ef572d
2010-10-08 15:49:53 -07:00
Romain Guy
eb99356a05 Optimize saveLayer() when the clip flag is set.
This speeds up applications, especially Launcher.
2010-10-05 18:14:38 -07:00
Romain Guy
f607bdc167 Correct implementation of saveLayer().
Change-Id: I5375126636913e0a84f2d6bbd0ebe40d2e4f2763
2010-09-12 12:24:12 -07:00
Romain Guy
fb8b763f76 Use only one GL context per process, share chaches.
Change-Id: Ieabaa25338d2f4b8d4fd90e7401ad6e7452eae11
2010-08-24 17:18:14 -07:00
Romain Guy
f7f93556c8 Draw n-patches using OpenGL.
Currently only tested with title bars and buttons.

Change-Id: I8263a9281898dc0e943b1b8412827fe55639b9d6
2010-07-08 19:19:07 -07:00
Romain Guy
f18fd99b5c Create FBOs in LayerCache.
This moves a bit of code away from OpenGLRenderer and matches
what happens with the TextureCache.

Change-Id: I3c67f54f83d7240770daa015861c0e75a1dd8c42
2010-07-08 11:45:51 -07:00
Romain Guy
6c81893c62 Simpler way to deal with the FBO multi-cache.
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
2010-07-07 15:15:32 -07:00
Romain Guy
5f0c6a4839 Optimize FBO cache.
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
2010-07-07 13:06:26 -07:00
Romain Guy
dda570201a Add a layer (FBO) cache.
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
2010-07-06 12:00:33 -07:00