20 Commits

Author SHA1 Message Date
Romain Guy
4bcb7467a1 Only recreate path textures when necessary
When a drawPath command is recorded in a display list, a copy of the
source path is made to preserve against possible modifications of the
said source path. Copies are discarded when a display list is cleared,
which usually happens on invalidate(). This means that even if a path
is never modified, the texture generated to draw it on screen is
destroyed every time an invalidate() is issued. This change fixes this
problem by introducing a reference to the source path in the copy.
If both the copy and the source path have the same genID, they are
the same path and can share the same texture.

Change-Id: I34849311c183e06336a1391d2d1568a087f973f6
2012-02-23 17:08:38 -08:00
Romain Guy
33f6beb10f Record possible clip rejects when recording display lists
This optimization allows us to quickly skip operations that lie
entirely outside of the known bounds of a display list. Because
of ViewGroup.setClipChildren, we must keep the operations recorded
in the display list. setClipChildren(false) is however a very
uncommon operation and we will therefore often benefit from this
new optimization.

Change-Id: I0942c864e55298e6dccd9977d15adefbce3ba3ad
2012-02-17 13:10:00 -08:00
Jeff Brown
d9e688cab3 Clean up GenerationCache.
Use const references to keys and values where appropriate to avoid
copying them unnecessarily.

Deleted some dead code.

Simplified a few pieces that were doing unnecessary redundant work.

Change-Id: Ib2145b7094a40db2d679e05dafe050fe1e87b846
2011-11-11 22:14:07 -08:00
Romain Guy
7b8b758924 Remove the right entries from the cache when a GC happens.
Change-Id: I4649b18c4721a5511a404299e771e675c843407b
2011-02-24 19:52:37 -08:00
Romain Guy
2fc941e465 Fixes cache misses and extra allocations.
Bug #3421454

Change-Id: If4d5c960a7e4c581a9d213073e658284b4e1c497
2011-02-03 16:20:08 -08:00
Romain Guy
ff26a0c1c9 Remove unnecessary code.
Change-Id: I83eba3406c26a4028af08b4d4c95ecd02803e75a
2011-01-20 11:39:09 -08:00
Romain Guy
32228288a9 Solve translucency issue when drawing paths.
Change-Id: I68ae0e2ccddaca2f76b5b2dd3e3cf1277fddaad6
2011-01-11 15:02:21 -08:00
Romain Guy
fe48f65922 Free resources only from the GL context thread.
Bug #3179882

Resources were freed following garbage collections on a worker thread.
This worker thread had no EGL context, which would cause the renderer
to incorrectly assume that the memory was liberated.

Change-Id: Ifdb51f94ddf42641e8654522787bfac532976c7c
2010-11-11 15:36:56 -08:00
Romain Guy
e190aa6975 Add new runtime debug flags.
Change-Id: I07955de166a89b5053c6c13f250bb3e2936ca86e
2010-11-10 19:01:29 -08:00
Romain Guy
9e10841c27 Correctly remove unused paths from the cache.
Change-Id: I41d9334dcd9871634037344ab49bf69383498161
2010-11-09 14:37:42 -08:00
Romain Guy
1041aded2d Fix possible rendering issue when drawing a path.
Change-Id: I25f2e609589f0dd9294bcf7930de6398c0d7e377
2010-11-04 12:10:40 -07:00
Romain Guy
d799912770 Make simple paths made of lines work.
Bug #3041098

Change-Id: Ife9c3f01ded10e2bb35b1cdf1a54734d8347fee4
2010-09-30 16:57:13 -07:00
Romain Guy
183f17e7eb A Path can exist in several cache entries.
Change-Id: I742f7425d2b6bef753ed3e04fb39ebb103b2dc00
2010-09-09 10:13:31 -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
fb8b763f76 Use only one GL context per process, share chaches.
Change-Id: Ieabaa25338d2f4b8d4fd90e7401ad6e7452eae11
2010-08-24 17:18:14 -07:00
Romain Guy
1e45aae5de Add drop shadows.
Change-Id: Ic6a72409d4785968d1fbdff229f17ee5c00b240b
2010-08-13 19:41:14 -07:00
Romain Guy
61c8c9c5b2 Fix tons of bugs and add new text rendering support.
Change-Id: I326c66b10784006f6df2f12d38e120cef94cd0d7
2010-08-10 12:22:01 -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
22158e139a Automatically cleanup textures that don't fit in the cache.
Change-Id: I4f29ed96ea11118b391fb957e1e4d1b8fcef1537
2010-08-06 11:18:34 -07:00
Romain Guy
7fbcc0492f Add support for paths.
Rendering is implementing by rasterizing the paths into A8 textures.
This cna be extremely inefficient if the path changes often.

Change-Id: I609343f304ae38e0d319359403ee73b9b5b3c93a
2010-08-05 17:23:49 -07:00