16 Commits

Author SHA1 Message Date
Romain Guy
21b028a44f Move GenerationCache to the utils directory.
Change-Id: I210ffa8f1d76a102bb7d971c649c20a74d03fbe6
2010-10-08 18:44:56 -07:00
Romain Guy
7adaf3d1aa Add support for paletted textures.
Change-Id: I36e6069bd58f78c609cdd1f3e4560c98f128f48e
2010-10-05 14:58:09 -07:00
Romain Guy
8c749f87d2 Fix texture corruption issue, faster re-upload of textures.
Bug #2950691

Change-Id: I57e2bc1d1a23e8683c25de7d09d6f5af2df59f41
2010-09-22 14:13:32 -07:00
Romain Guy
a2341a9f6a Purge Skia objects from GL caches as needed.
Change-Id: I754c671cf790ad5ae8bf047ad328034217da4ecc
2010-09-08 18:04:33 -07:00
Romain Guy
9aaa8269a3 Fix possible infinite loop when purging textures.
Change-Id: Ib05b398ae03e734da2dab0496df416fed4570b1c
2010-09-08 15:15:43 -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
1639351139 Make libhwui entirely optional.
The makefile variable USE_OPENGL_RENDERER must be set to true to compile
libhwui and the related code in the JNI layer.

This change also removes obsolete APIs from Canvas that must not be used
and would be confusing if left in. These APIs were remnants of our first
attempt at an OpenGL renderer for the view hierarchy and had not been
taken out before Android 1.0 was released.

Change-Id: I2475ff1307212bab26c926724f3c508681c7dae1
2010-08-08 17:45:07 -07:00
Romain Guy
9cccc2b9bd Enforce maximum texture size.
When an app tries to render a bitmap or path larger than the GPU's maximum
texture size, the drawing command is ignored and a warning is logged. This
change also makes texture drawing more robust by catching potential errors
during texture creation.

This change also fixes a crash in the FontRenderer. The destructor would
sometimes try to free an uninitialized array.

Change-Id: I95ae0939c52192d97b340aa02417bf6d0c962c57
2010-08-07 23:48:29 -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
Romain Guy
7d139ba2c3 Remove extra leftover logs and use uint32_t instead of unsigned int.
Change-Id: I944f82fe3255de38dc04048cc8bd861f578f01a7
2010-07-02 11:20:34 -07:00
Romain Guy
121e224256 Track the size in memory of the texture cache.
The texture cache was previously checking the number of stored textures. This was
not very useful as this could easily lead to an abuse of memory. The new cache
instead tracks the total size occupied in RAM by the cached textures. When a new
texture is generated, older textures are kicked out as needed.

Change-Id: Ib27142f4a018d5bf84774c1fb6f45a67a85f20bc
2010-07-01 18:26:52 -07:00
Romain Guy
fe8809471a Remove unnecessary return and add bitmap generation ID tracking.
Change-Id: Icf5e0635e789f5ea53268c22fad51cf733b5b1a6
2010-06-30 16:05:32 -07:00
Romain Guy
364703c6fa Fix the build.
Change-Id: I08bd6daf25351daca3ae552e1cfcfce85eefa73b
2010-06-30 15:51:03 -07:00
Romain Guy
ce0537b800 Add hooks for drawBitmap().
Change-Id: I58e962c3a8b2bc75c2605fe369ad3002579d86e0

Add texture cache.

Change-Id: I1c0e5581d228869e114438258a1014e33e024ad7
2010-06-30 15:21:01 -07:00