summaryrefslogtreecommitdiffstats
path: root/libs/hwui/PathCache.h
Commit message (Collapse)AuthorAgeFilesLines
* Refcount 9-patches and properly handle GC eventsRomain Guy2013-06-261-1/+1
| | | | | | | | | | | | | | | | | This change adds refcounting of Res_png_9patch instances, the native data structure used to represent 9-patches. The Dalvik NinePatch class now holds a native pointer instead of a Dalvik byte[]. This pointer is used whenever we need to draw the 9-patch (software or hardware.) Since we are now tracking garbage collection of NinePatch objects libhwui's PatchCache must keep a list of free blocks in the VBO used to store the meshes. This change also removes unnecessary instances tracking from GLES20DisplayList. Bitmaps and 9-patches are refcounted at the native level and do not need to be tracked by the Dalvik layer. Change-Id: Ib8682d573a538aaf1945f8ec5a9bd5da5d16f74b
* Introduce Caches::bindTexture() to reduce glBindTexture callsRomain Guy2013-06-041-1/+1
| | | | Change-Id: Ic345422567c020c0a9035ff51dcf2ae2a1fc59f4
* Path precaching creates duplicate cache entriesRomain Guy2013-03-261-6/+7
| | | | | | Bug #8478275 Change-Id: Ib541ea051e42e01cc0d277790e9c09de38ef72ee
* Stop worker threads on memory trim & fix bad pointer accessRomain Guy2013-03-201-5/+11
| | | | Change-Id: I6fe7e31aeb6dd41fa65ab952caed97bc2da510d7
* Merge all shapes/paths caches to PathCacheRomain Guy2013-03-181-30/+219
| | | | | | | | | This change will greatly simplify the multi-threading of all shape types. This change also uses PathTessellator to render convex paths. Change-Id: I4e65bc95c9d24ecae2183b72204de5c2dfb6ada4
* Add TaskManager APIRomain Guy2013-03-121-18/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This API can be used to run arbitrary tasks on a pool of worker threads. The number of threads is calculated based on the number of CPU cores available. The API is made of 3 classes: TaskManager Creates and manages the worker threads. Task Describes the work to be done and the type of the output. A task contains a future used to wait for the worker thread to be done computing the result of the task. TaskProcessor The processor dispatches tasks to the TaskManager and is responsible for performing the computation required by each task. A processor will only be asked to process tasks sent to the manager through the processor. A typical use case: class MyTask: Task<MyType> class MyProcessor: TaskProcessor<MyType> TaskManager m = new TaskManager(); MyProcessor p = new MyProcessor(m); MyTask t = new MyTask(); p.add(t); // Waits until the result is available MyType result = t->getResult(); Change-Id: I1fe845ba4c49bb0e1b0627ab147f9a861c8e0749
* Precache paths from a worker threadRomain Guy2013-03-111-0/+36
| | | | Change-Id: I3e7b53d67e0e03e403beaf55c39350ead7f1e309
* Use LruCache instead of GenerationCache in libhwuiRomain Guy2012-11-291-7/+15
| | | | Change-Id: Ic26ddc7151eb5462bcd243b21daf7187ed6d3bec
* Make sure we correctly copy caches keys.Romain Guy2011-08-121-4/+0
| | | | | | Bug #5136067 Change-Id: I366e840bef44415436dc7b13d89cfb610feed663
* Fix paths rendering issues.Romain Guy2011-03-181-2/+2
| | | | | | See ApiDemos, PathEffect and PathFillTypes. Change-Id: I9f9593c1da33d0d013b5b89c86bc5bd71128a192
* Remove unnecessary code.Romain Guy2011-01-201-122/+17
| | | | Change-Id: I83eba3406c26a4028af08b4d4c95ecd02803e75a
* Free resources only from the GL context thread.Romain Guy2010-11-111-4/+14
| | | | | | | | | | 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
* Add new runtime debug flags.Romain Guy2010-11-101-0/+2
| | | | Change-Id: I07955de166a89b5053c6c13f250bb3e2936ca86e
* 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
* Correctly remove unused paths from the cache.Romain Guy2010-11-091-0/+18
| | | | Change-Id: I41d9334dcd9871634037344ab49bf69383498161
* 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
* Small cleanup.Romain Guy2010-10-181-6/+6
| | | | Change-Id: I0e5b9154a2d93af793d62f462d68cb7c6c3f6d75
* Use VBOs to render most geometries.Romain Guy2010-10-181-6/+6
| | | | Change-Id: I4360dc4fe5693ab425450c107282b2c22db4dca7
* Optimize 9patch rendering.Romain Guy2010-10-121-1/+13
| | | | | | | This change detects empty quads in 9patches and removes them from the mesh to avoid unnecessary blending. Change-Id: I4500566fb4cb6845d64dcb59b522c0be7a0ec704
* Move GenerationCache to the utils directory.Romain Guy2010-10-081-1/+1
| | | | Change-Id: I210ffa8f1d76a102bb7d971c649c20a74d03fbe6
* Purge Skia objects from GL caches as needed.Romain Guy2010-09-081-0/+10
| | | | Change-Id: I754c671cf790ad5ae8bf047ad328034217da4ecc
* Use only one GL context per process, share chaches.Romain Guy2010-08-241-0/+3
| | | | Change-Id: Ieabaa25338d2f4b8d4fd90e7401ad6e7452eae11
* Enforce maximum texture size.Romain Guy2010-08-071-0/+1
| | | | | | | | | | | | 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
* Automatically cleanup textures that don't fit in the cache.Romain Guy2010-08-061-0/+3
| | | | Change-Id: I4f29ed96ea11118b391fb957e1e4d1b8fcef1537
* Add support for paths.Romain Guy2010-08-051-0/+144
Rendering is implementing by rasterizing the paths into A8 textures. This cna be extremely inefficient if the path changes often. Change-Id: I609343f304ae38e0d319359403ee73b9b5b3c93a