summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Caches.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Correctly adjust clip regions that lie offscreenChet Haase2012-10-161-3/+14
| | | | | | | | | | We were clamping the x/y location of the scissor to 0,0, but not adjusting the width/height appropriately. This fix adjusts width/height and also clamps them to 0 to correctly clip out offscreen operations. Issue #7221524 Top left and top right portions of the screen blanks out after some time Change-Id: I47f23336ea612409ed86652b9a68e272819ef00e
* Work around a possible driver bugRomain Guy2012-10-071-0/+1
| | | | | | | | | | Bug #7296475 When re-enabling the scissor the driver seems to ignore the already existing scissor box. This change resets the scissor box when the test state changes. Change-Id: I3a68433164f99d21fbab769a26c56fe416c1539a
* Fix texture corruptionChet Haase2012-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | When memory gets low on a device, activities flush everything they can. Hardware-accelerated activites, such as Launcher, flush GL resources and destroy the GL context. However, some resources were still hanging around, due to deferred destruction policies (we don't delete layers until the DisplayLists they are in are finalized, to ensure we don't deref deleted objects). This meant that we were referring to obsolete GL data in these objects. in particular, it meant that we might come around later, after a new GL context was created, and delete a texture object that was incorrect. We use the layer's "texture id" to refer to the texture underlying the layer. But if there's a new GL context, then this texture ID is no longer valid, and we may be deleting the texture that a different object (layer, icon, whatever) is referring to, because the driver may return that same ID under the new GL context. The fix is to more aggressively delete things that we know will not be used again when the GL context is destroyed. In particular, we delete all resources being used by all DisplayLists at GL context destruction time. Issue #7195815 Textures corruption on all devices, in many apps Change-Id: I52d2d208173690dbb794a83402d38f14ea4c6c22
* Merge changes I9873540e,I4f6c38e3 into jb-mr1-devRomain Guy2012-09-271-0/+18
|\ | | | | | | | | | | * changes: Skia's ColorMatrix vector is in the 0..255 range not 0..1 Bug #7248980 Don't use the QCOM_tiled_rendering extension with functors Bug #7247880
| * Don't use the QCOM_tiled_rendering extension with functorsRomain Guy2012-09-271-0/+18
| | | | | | | | | | | | Bug #7247880 Change-Id: I4f6c38e37b953c58e6107097c613891a49dac766
* | Add stroke support to polygonal shape renderingChris Craik2012-09-261-3/+7
|/ | | | | | | | | | | | bug:4419017 bug:7230005 - Adds support for stroke/strokeAndFill for shapes without joins - Fixes path-polygonization threshold calculation - Fixes rendering offset (now only used for points) - Several formatting fixes Change-Id: If72473dc881e45752e2ec212d0dcd1e3f97979ea
* fix a possible dead-lock when clearing cachesMathias Agopian2012-09-251-9/+17
| | | | | Bug: 7195815 Change-Id: I8e226b7ec445f9f4fe46ae216ef7cc41efc5a0fd
* make sure to destroy GL objects on the GL threadMathias Agopian2012-09-251-1/+1
| | | | | Bug: 7195815 Change-Id: I5bcac61cd0b903d1ccca0754fdb9cb1023efbe0f
* Fix overdraw debug on QCOMRomain Guy2012-09-231-5/+3
| | | | | | | Disable the use of the tiling extension when overdraw debug is turned on. Change-Id: Ib0a0b7d1998146aa0c7efef2d3822f9997efb123
* Add support for a new developer setting: overdraw debuggingRomain Guy2012-09-211-1/+10
| | | | Change-Id: I350ba4486577c3289f82c20938f7a35138778727
* Optimize tiling managementRomain Guy2012-09-201-1/+1
| | | | | | Bug #7186819 Change-Id: Iebc42a6e9c96ad5605fbbe1539aa887695d2e829
* Add support for QCOM_tiled_renderingRomain Guy2012-09-191-2/+2
| | | | | | | | | Bug #7186819 This optional OpenGL extension can be used by tiled renderers to optimize copies from main memory to tiles memory. Change-Id: Id4a5d64e61ad17f50e773e8104b9bf584bb65077
* Minimize state changes when updating layersRomain Guy2012-09-181-0/+3
| | | | Change-Id: I407fcc80bd3178f9f09a3b379ceb7f7ce0749e08
* Foundation for tiling optimizationRomain Guy2012-09-131-0/+28
| | | | Change-Id: I4db32a4749f196472ba0dde7e102439d2ba4a3a7
* Add new debug tool to track hardware layers updatesRomain Guy2012-08-061-4/+11
| | | | | | | | You can setprop debug.hwui.show_layers_updates true to flash hw layers in green when they update. This is also a setting in the Dev. section of the settings app. Change-Id: Ibe1d63a4f81567dc1d590c9b088d2e7505df8abf
* Add dithering to gradientsRomain Guy2012-08-011-0/+1
| | | | Change-Id: Ic1208855bde3a254eca2fd7cef43e0f1318ce419
* Don't clear the dirty clip flag if it's not appliedRomain Guy2012-07-171-3/+10
| | | | | | Bug #6833979 Change-Id: I0ea78b7f31a557a335de10d910d03b0520029080
* Refactor GammaFontRendererRomain Guy2012-07-131-6/+12
| | | | | | | This change is the first step to a shader-based text antialias gamma correction. Change-Id: I9eb02d4c56cb95d05219f712290c865b46141954
* Improve rendering speed by disabling scissor testsRomain Guy2012-07-131-1/+26
| | | | | | | | | | | | This change improves execution of display lists, particularly on tiled renderers. The goal is to disable the scissor test as often as possible. Drawing commands are rarely clipped by View bounds so most of them can be drawn without doing a scissor test. The speed improvements scale with the number of views and drawing commands. Change-Id: Ibd9b5e051a3e4300562463805acc4fd744ba6266
* Add call sites for OpenGL's debug label extensionRomain Guy2012-05-121-18/+32
| | | | Change-Id: I9c689127e8166cbef92c935f8aa07217ab806dda
* Delete display list objects and resources on the UI threadRomain Guy2012-03-051-0/+13
| | | | | | | | | | | | | | Bug #6073717 Bug #6065504 Bug #6026515 Bug #5971725 Prior to this patch, the destructor of DisplayList would always run on the finalizer thread. This could cause a race condition if the UI thread was busy rendering display lists at the same time leading to various random native crashes. Change-Id: Ie11108e3b1538d4b358a1a8b4cce1b2d33152d0c
* Add debug markers to OpenGLRendererRomain Guy2012-01-301-0/+10
| | | | | | | | These markers will be used to group the GL commands by View in the OpenGL ES debugging tool. This will help correlate individual GL calls to higher level components like Views. Change-Id: I73607ba2e7224a80ac32527968261ee008f049c6
* Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-01-061-1/+1
| | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-3/+3
| | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
* Properly restore the GL scissor after a GL draw functorRomain Guy2012-01-031-0/+4
| | | | | | Bug #5781254 Change-Id: I1dc4809563a793b6b579814951d4d73b4c34bf32
* Generate even fewer GL commandsRomain Guy2011-12-141-0/+13
| | | | Change-Id: I0f4dcacb03ef5ee7f6ebd501df98bfead5f0a7f8
* <Insert something improper about OpenGL>Romain Guy2011-12-131-0/+1
| | | | Change-Id: Ib645376093838156771588adc76a718da0ceb0db
* Further reduce the number of GL commands sent to the driverRomain Guy2011-12-131-0/+10
| | | | Change-Id: Id922b2a166ea4573b767c27d3195e11c70320b23
* Reduce the number of GL commands generated by the UIRomain Guy2011-12-131-2/+37
| | | | | | | | This optimization along with the previous one lets us render an application like Gmail using only 30% of the number of GL commands previously required Change-Id: Ifee63edaf495e04490b5abd5433bb9a07bc327a8
* Optimize state changesRomain Guy2011-12-121-4/+34
| | | | Change-Id: Iae59bc8dfd6427d0967472462cc1994987092827
* Terminate EGL when an app goes in the backgroundRomain Guy2011-11-101-9/+35
| | | | | | | | This does not happen on high end gfx devices. This happens only if only one EGL context is initialized in the current process. Change-Id: Ibd1737efdf84eef8a84108b05795440d1ae9964e
* Memory optimizations for libhwuiRomain Guy2011-11-041-0/+3
| | | | | | | | | | | Bug #5566149 Lazily initialize font renderers Keep 60% of the texture cache when an app goes to the background Delete least used font renderer when going to the background Delete all font renderers on full memory trim Change-Id: I3c2454d46dc1107ec0f0f72a9ce69cbbcc8825e7
* Reduce the amount of data cached by the gradients cache.Romain Guy2011-08-011-1/+0
| | | | Change-Id: I8546f5a5ecf38031c9a40bdcc434d4c7f22da63d
* Destroy layers and flush layers cache when a window is destroyed.Romain Guy2011-07-271-1/+3
| | | | Change-Id: I3fa1bc3ff50fb99e3d2e490925bd6b0a0f809fff
* Trim OpenGLRenderer's memory usage whenever possibleRomain Guy2011-07-181-0/+34
| | | | Change-Id: I9225077184f374b1a43300add15cc1d5b6869d1c
* Fix debugging for hwui cachesKenny Root2011-07-131-1/+0
| | | | | | | | | Debugging code attempted to delete a stack item. Also, the flag fields weren't exactly clear, so rewrite it so it's clear that kDebugMoreCaches is a combined flag. Change-Id: If42b7f0f754919343301da5656aee5943cc9bd4a
* Code cleanupRomain Guy2011-06-241-1/+1
| | | | Change-Id: I64c346004e0adf9a776d0315534d4fe445f0c0ca
* Prettify memory dump.Romain Guy2011-05-271-1/+1
| | | | Change-Id: I071c6a04a144a96955d85f56dffc6162288ee33e
* Add logging of graphics acceleration info to bugreportsChet Haase2011-04-011-18/+31
| | | | Change-Id: I9fa4cda6ccf92df9d1c644ccdc0e7274a30106e0
* Fixes cache misses and extra allocations.Romain Guy2011-02-031-0/+11
| | | | | | Bug #3421454 Change-Id: If4d5c960a7e4c581a9d213073e658284b4e1c497
* Allocate layers from the layers pool.Romain Guy2011-02-021-6/+2
| | | | | | | | | | | 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
* Add rounded rects and circles support to OpenGLRenderer.Romain Guy2011-01-191-0/+4
| | | | Change-Id: I6cedf2b495d58de7c0437096809fa9e4518a1b8c
* Cleanup implementation of hardware layers.Romain Guy2011-01-131-17/+10
| | | | | | | | | | The new implementation relies on OpenGLRenderer's existing layer code instead of duplicating it. The new code is much cleaner, with simpler and better APIs and allows tracking of drawn regions inside layers. Region tracking is not yet enabled but this will be done in a future CL. Change-Id: Ie826121a2227de8252c77b992a61218defea5143
* Cleanup GL objects on the correct thread.Romain Guy2011-01-121-0/+26
| | | | Change-Id: Iddfea6e08a6591a4fab147151098ef27005f373d
* Composite layers as regions.Romain Guy2011-01-101-0/+4
| | | | | | | | | | This change detects what area of a layer was drawn into and generates a mesh to match this area exactly. This can be used to avoid blending empty pixels when the layer is composited. This change also adds proper layers support to lines rendering and implements layers composition in a more readable way. Change-Id: I4a5588b98b19bd66891ebdc39631b193c5e31999
* Free resources only from the GL context thread.Romain Guy2010-11-111-0/+10
| | | | | | | | | | 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/+4
| | | | Change-Id: I07955de166a89b5053c6c13f250bb3e2936ca86e
* Move all debug flags in a single place.Romain Guy2010-11-101-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | 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-9/+39
| | | | | | | | | 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
* Remove unnecessary GL calls.Romain Guy2010-10-261-0/+2
| | | | | | | This change batches calls to glScissor() and removes extra GL queries and glActiveTexture() calls. Change-Id: I1cd079d314f87cd9c088f95c8d4909c2f860f6aa