summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Properties.h
Commit message (Collapse)AuthorAgeFilesLines
* Add overdraw debugging that accounts for DeuteranomalyRomain Guy2013-08-211-2/+9
| | | | Change-Id: I31f68a07aa7cf0490d2572e24e4c5ac2066a1151
* Share Caches' index buffer with FontRendererRomain Guy2013-06-181-0/+6
| | | | | | | | | This reduces state changes when we draw 9patches and text together, which happens *a lot*. Also disable the NV profiling extension by default since it doesn't play nice with display lists deferrals. To enable it set debug.hwui.nv_profiling to true. Change-Id: I518b44b7d294e5def10c78911ceb9f01ae401609
* Enable GPU pixel buffers on OpenGL ES 3.0 devicesRomain Guy2013-06-041-2/+2
| | | | Change-Id: I164d72ccd7a9bf6ae0e3f79dfef50083558937ba
* Add an on-screen overdraw counterRomain Guy2013-05-031-2/+2
| | | | | | | | | The counter can be enabled by setting the system property called debug.hwui.overdraw to the string "count". If the string is set to "show", overdraw will be highlighted on screen instead of printing out a simple counter. Change-Id: I9a9c970d54bffab43138bbb7682f6c04bc2c40bd
* Pack preloaded framework assets in a texture atlasRomain Guy2013-05-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the Android runtime starts, the system preloads a series of assets in the Zygote process. These assets are shared across all processes. Unfortunately, each one of these assets is later uploaded in its own OpenGL texture, once per process. This wastes memory and generates unnecessary OpenGL state changes. This CL introduces an asset server that provides an atlas to all processes. Note: bitmaps used by skia shaders are *not* sampled from the atlas. It's an uncommon use case and would require extra texture transforms in the GL shaders. WHAT IS THE ASSETS ATLAS The "assets atlas" is a single, shareable graphic buffer that contains all the system's preloaded bitmap drawables (this includes 9-patches.) The atlas is made of two distinct objects: the graphic buffer that contains the actual pixels and the map which indicates where each preloaded bitmap can be found in the atlas (essentially a pair of x and y coordinates.) HOW IS THE ASSETS ATLAS GENERATED Because we need to support a wide variety of devices and because it is easy to change the list of preloaded drawables, the atlas is generated at runtime, during the startup phase of the system process. There are several steps that lead to the atlas generation: 1. If the device is booting for the first time, or if the device was updated, we need to find the best atlas configuration. To do so, the atlas service tries a number of width, height and algorithm variations that allows us to pack as many assets as possible while using as little memory as possible. Once a best configuration is found, it gets written to disk in /data/system/framework_atlas 2. Given a best configuration (algorithm variant, dimensions and number of bitmaps that can be packed in the atlas), the atlas service packs all the preloaded bitmaps into a single graphic buffer object. 3. The packing is done using Skia in a temporary native bitmap. The Skia bitmap is then copied into the graphic buffer using OpenGL ES to benefit from texture swizzling. HOW PROCESSES USE THE ATLAS Whenever a process' hardware renderer initializes its EGL context, it queries the atlas service for the graphic buffer and the map. It is important to remember that both the context and the map will be valid for the lifetime of the hardware renderer (if the system process goes down, all apps get killed as well.) Every time the hardware renderer needs to render a bitmap, it first checks whether the bitmap can be found in the assets atlas. When the bitmap is part of the atlas, texture coordinates are remapped appropriately before rendering. Change-Id: I8eaecf53e7f6a33d90da3d0047c5ceec89ea3af0
* Introduce PixelBuffer API to enable PBOsRomain Guy2013-04-111-12/+38
| | | | | | | | | | | | | | | | | | | | | | | PBOs (Pixel Buffer Objects) can be used on OpenGL ES 3.0 to perform asynchronous texture uploads to free up the CPU. This change does not enable the use of PBOs unless a specific property is set (Adreno drivers have issues with PBOs at the moment, Mali drivers work just fine.) This change also cleans up Font/FontRenderer a little bit and improves performance of drop shadows generations by using memcpy() instead of a manual byte-by-byte copy. On GL ES 2.0 devices, or when PBOs are disabled, a PixelBuffer instance behaves like a simple byte array. The extra APIs introduced for PBOs (map/unmap and bind/unbind) are pretty much no-ops for CPU pixel buffers and won't introduce any significant overhead. This change also fixes a bug with text drop shadows: if the drop shadow is larger than the max texture size, the renderer would leave the GL context in a bad state and generate 0x501 errors. This change simply skips drop shadows if they are too large. Change-Id: I2700aadb0c6093431dc5dee3d587d689190c4e23
* Minimize texture binds when drawing textRomain Guy2013-03-191-1/+1
| | | | | | | | | | | When several CacheTextures are used to draw text, sort the draw batches by texture ID to minimize state changes in the driver. This change also tweaks the font cache size and renames a property that was too long to be set using setprop. Change-Id: I0a36dfffe58c9e75dd7384592d3343c192d042b1
* Merge all shapes/paths caches to PathCacheRomain Guy2013-03-181-3/+1
| | | | | | | | | This change will greatly simplify the multi-threading of all shape types. This change also uses PathTessellator to render convex paths. Change-Id: I4e65bc95c9d24ecae2183b72204de5c2dfb6ada4
* Rename debug property and expose it in HardwareRendererRomain Guy2013-02-251-1/+1
| | | | Change-Id: If46a9bc14a50f6c9a202d901881b36bbac32cba3
* Add new property to debug non-rectangular clip operationsRomain Guy2013-02-251-0/+14
| | | | | | | | | | | | | This change adds a new property called "debug.hwui.show_stencil_clip" that accepts the following values: - "highlight", colorizes in green any drawing command that's tested against a non-rectangular clip region - "region", shows the non-rectangular clip region in blue every time it is used - "hide", default value, nothing is shown Change-Id: I83c8602310edc4aaeb8b905371cdd185b17d32b5
* DisplayList draw operation reorderingChris Craik2013-02-151-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | bug:8037003 The reordering enables similar operations to draw together, minimizing the OpenGL state change operations that go inbetween draws. Eventually, multiple complete canvas draw operations will be merged (into a single glDrawArrays call, for example) Reorders DisplayList draw operations when: -They can move backwards in the command stream to be after similar operations without violating draw ordering -The OpenGLRenderer is in a simple, replayable state (no complex clip, or filter/shadow etc) Also adds two system properties to control the deferral/reordering: "debug.hwui.disable_draw_defer" "debug.hwui.disable_draw_reorder" which can be set to "true" to control the display list manipulation Change-Id: I5e89f3cb0ea2d2afd3e15c64d7f32b8406777a32
* Add a render buffer cache to reuse stencil buffersRomain Guy2013-02-131-2/+4
| | | | | | | | | | 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
* Add a property to disable libhwui's scissor optimizationRomain Guy2012-09-241-0/+15
| | | | | | | | | | | | | | | Bug #7158326 When scissor optimization is enabled, OpenGLRenderer will attempt to minimize the use of scissor by selectively enabling and disabling the GL scissor test. When the optimization is disabled, OpenGLRenderer will keep the GL scissor test enabled and change the scissor rect as needed. Some GPUs (for instance the SGX 540) perform better when changing the scissor rect often than when enabling/disabling the scissor test often. Change-Id: Idb68862e287a23358f9188d577ae0f86161902fd
* Add support for a new developer setting: overdraw debuggingRomain Guy2012-09-211-2/+8
| | | | Change-Id: I350ba4486577c3289f82c20938f7a35138778727
* Paramaterize and adjust the glyph cache sizesChet Haase2012-08-311-2/+4
| | | | | | | | | Add new parameters for the texture size used for the larger, fallback caches. Bump up the defaults in some situations. Issue #7045164 Adjust cache sizes for manta Change-Id: I562118ce785d7f8b6e445178878672e9709d25f2
* Add new debug tool to track hardware layers updatesRomain Guy2012-08-061-5/+9
| | | | | | | | 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
* Tweak text gamma correctionRomain Guy2012-07-181-3/+2
| | | | Change-Id: Icd3326e6a054d6020c3ed61c8459394bc87401dd
* Add a new method for text gamma correctionRomain Guy2012-07-181-5/+20
| | | | | | | | | | | | | | | | | | | To select the gamma correction method, adb shell setprop hwui.text_gamma_correction with one of the following values: lookup3 lookup shader3 shader See Properties.h for more information about these different methods. You can also control gamma correction using the following properties: hwui.text_gamma hwui.text_gamma.black_threshold hwui.text_gamma.white_threshold Change-Id: I47970b804d2c590c37d3da5008db094241579e25
* Refactor GammaFontRendererRomain Guy2012-07-131-0/+6
| | | | | | | This change is the first step to a shader-based text antialias gamma correction. Change-Id: I9eb02d4c56cb95d05219f712290c865b46141954
* Remove obsolete optimizationRomain Guy2012-07-121-3/+0
| | | | Change-Id: I2d43c009c62a7f4a4a2e0a6303bdfa692c4b8c8c
* Separate interface definition and implementation of SnapshotRomain Guy2012-02-021-2/+2
| | | | | | | | The Snapshot class is getting complicated enough that its implementation should now live in a separate .cpp file. This will become particularly useful when support for clip regions and paths will be added later on. Change-Id: I050fac5683a9f7a0ff2f7a6beec3dd28aa5eb0d8
* Add stencil buffer to the EGL configRomain Guy2012-01-301-0/+5
| | | | Change-Id: If76c0cd6127534d90f9526b75c0f8e56259c6722
* Code cleanupRomain Guy2011-12-091-1/+4
| | | | Change-Id: If92e3addfc4d8546a60edcdea60a1fc89c27b680
* Free up resources by deleting shaders early onRomain Guy2011-12-091-1/+1
| | | | Change-Id: I29a39775732c0a48d3e6823f7afa3e741cae8541
* Memory optimizations for libhwuiRomain Guy2011-11-041-0/+5
| | | | | | | | | | | 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
* Move constants to the correct headerRomain Guy2011-08-221-0/+6
| | | | Change-Id: Id4bd14f72487bd7156cd2e1930eaf97b47896273
* Reclaim more memory, more often.Romain Guy2011-07-271-1/+1
| | | | | | Yay. Change-Id: I04557ad575c307a55088549f48f0e9ad994b7275
* Fix debugging for hwui cachesKenny Root2011-07-131-1/+1
| | | | | | | | | 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
* Add support to OpenGLRendere to draw BiDi text.Romain Guy2011-06-011-0/+3
| | | | | | Bug #4350336 Change-Id: I1cf31693f7ca9653fa3a41b5b91c27ef288d680f
* Optimize rect-shaped layers.Romain Guy2011-03-181-2/+0
| | | | | | | This brings back an optimization disabled in HC-MR1. This time the correct geometry is generated to avoid unnecessary blending. Change-Id: Id56404dc46bb84c75facc25c18488a690741b592
* Fix performance issue in LauncherRomain Guy2011-03-151-0/+2
| | | | | | | | | | | | | | Bug #3515248 The problem is caused by the fast path when compositing layers on screen. The fast path draws a single quad using glDrawArrays() whereas the general path draws an arbitrary mesh using glDrawElements(). It looks like there's an issue in the driver since glDrawArrays() is significantly slower than glDrawElements() for a quad (6 vertices!) This change just gets rid of the fast path. Change-Id: Ib2361253ec67f44a988270f76c183422f12ce537
* Allocate layers from the layers pool.Romain Guy2011-02-021-3/+3
| | | | | | | | | | | 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/+2
| | | | Change-Id: I6cedf2b495d58de7c0437096809fa9e4518a1b8c
* Reenable region composition pipeline for layersRomain Guy2011-01-121-1/+1
| | | | | | | | Bug #3341848 It works this time! Change-Id: I0d371d8b2c75c67d4ce5009ddb990fe5e55a0a27
* Disable the region compositing pipeline for layers.Romain Guy2011-01-111-1/+1
| | | | | | | This composition mode is affecting Gmail in a bad way. Disabling until I can figure out the problem. Change-Id: I00e657ea2d05fc7b4a606242d19dc84dd88c1e35
* Composite layers as regions.Romain Guy2011-01-101-1/+1
| | | | | | | | | | 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
* Correctly compare strings in UTF-8 instead of UTF-16Romain Guy2010-12-101-1/+2
| | | | | | Bug #3272858 Change-Id: Idacd5d7c2c052b4834a8ddb5906ab32b3f548f73
* Don't render degenerate triangles in 9patches.Romain Guy2010-12-031-0/+3
| | | | | | Bug #3251983 Change-Id: Ib0b38a7b8111542372f4c4c106b6321c26fe4ad4
* Add new runtime debug flags.Romain Guy2010-11-101-0/+23
| | | | Change-Id: I07955de166a89b5053c6c13f250bb3e2936ca86e
* Optimize FBO drawing with regions.Romain Guy2010-11-021-5/+5
| | | | | | | | | 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
* Tweak layers caching for better performance in Launcher.Romain Guy2010-10-121-2/+2
| | | | Change-Id: Ia6e67699d98f69c8a93385b3ecbdd814c7b16921
* Don't update 9patches on every frame.Romain Guy2010-10-081-1/+1
| | | | Change-Id: I7ffb2365f83e0453e7d0a0cdcb3fc9308b305238
* Better cache for layers, reduce memory usage and increase framerate.Romain Guy2010-10-081-3/+3
| | | | Change-Id: I5ff864a361db4791bd5ff6be716f7ce692ef572d
* Optimize saveLayer() when the clip flag is set.Romain Guy2010-10-051-1/+1
| | | This speeds up applications, especially Launcher.
* Add debug mode to measure performance.Romain Guy2010-09-241-3/+5
| | | | Change-Id: I9d4c84034dc200b99c8266165942a7cdbcb5c0c5
* Apply gamma correction to font rendering.Romain Guy2010-08-271-0/+9
| | | | Change-Id: I1b05f40e356221b2a5eb9400e67d77ecd98ed6c4
* Use only one GL context per process, share chaches.Romain Guy2010-08-241-0/+12
| | | | Change-Id: Ieabaa25338d2f4b8d4fd90e7401ad6e7452eae11
* Add drop shadows.Romain Guy2010-08-131-0/+1
| | | | Change-Id: Ic6a72409d4785968d1fbdff229f17ee5c00b240b
* Add support for paths.Romain Guy2010-08-051-1/+1
| | | | | | | Rendering is implementing by rasterizing the paths into A8 textures. This cna be extremely inefficient if the path changes often. Change-Id: I609343f304ae38e0d319359403ee73b9b5b3c93a
* Cleanup, added properties for the FontRenderer.Romain Guy2010-07-231-0/+35
Change-Id: I909c74815d3ac394438ad8071d17fef5401dbeed