summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Debug.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix behavior of stencil clipping within clearLayerRegionsChris Craik2014-07-291-0/+3
| | | | | | | | | | | | bug:16376960 The draw within clearLayerRegions should never be affected by the current stencil clip, since it's just ensuring that the content of the layer is cleared, and not doing real content drawing. Also, add optional verbose GL event logging Change-Id: I538b1bc631fc091340b76e12db6af0c219851b57
* Create private properties on GLCanvas for experimentation with 3dChris Craik2013-12-161-3/+0
| | | | Change-Id: I17772f61efce727cb4c1111f4d97f58c741786b8
* Calculate and show Ambient shadow.ztenghui2013-12-131-0/+3
| | | | | | | | | Basically we compute the shadow as a strip of triangles, whose alpha value is the strength of the shadow. We use the normal to extend the geometry. And we use static function and try to avoid new/malloc in the computation. Change-Id: I382286f1cad351bd5ff983f76f446c075819dcaf
* 3d view system!Chris Craik2013-12-121-0/+3
| | | | | | | | | | | | | | | | | | | True 3d transformations are now supported by DisplayLists and the renderer, initially with the translationZ property on view. Renderer operations used directly by DisplayList (formerly, clip/save/restore/saveLayer) are now more simply managed by allocating them temporarily on the handler's allocator, which exists for a single frame. This is much simpler than continuing to expand the pool of pre-allocated DisplayListOps now that more operations are called directly by DisplayList, especially with z ordered drawing. Still TODO: -APIs for camera positioning, shadows -Make Z apis public, and expose through XML -Make invalidation / input 3d aware Change-Id: I95fe6fa03f9b6ddd34a7e0c6ec8dd9fe47c6c6eb
* Pack preloaded framework assets in a texture atlasRomain Guy2013-05-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Draw Operation mergingChris Craik2013-04-151-0/+3
| | | | | | | | | | | | | | | | | | Merge simple bitmap draw operations and text operations to avoid issuing individual gl draws for each operation. Merging other ops to be done eventually. The methods are different - the bitmap merging generates a single mesh for reused, unclipped images (esp. repeated images in a listview) The text approach queries just defers the normal font rendering until the last drawText in the sequence that can share the same shader. Patches are sorted and merged, but don't yet have a multiDraw implementation. For now, the pretending-to-merge gives better sorting behavior by keeping similar patches together. Change-Id: Ic300cdab0a53814cf7b09c58bf54b1bf0f58ccd6
* Merge all shapes/paths caches to PathCacheRomain Guy2013-03-181-1/+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
* Add new property to debug non-rectangular clip operationsRomain Guy2013-02-251-0/+1
| | | | | | | | | | | | | 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/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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-0/+3
| | | | | | | | | | 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 RenderBuffer object to store stencil buffers.Romain Guy2013-02-071-0/+3
| | | | | | | | | | | | | | | | | | Bug #7146141 This change is needed to add a render buffer cache to avoid creating and destroying stencil buffers on every frame. This change also allows the renderer to use a 1 bit or 4 bit stencil buffer whenever possible. Finally this change fixes a bug introduced by a previous CL which causes the stencil buffer to not be updated in certain conditions. The fix relies on a new optional parameter in drawColorRects() that can be used to avoid performing a quickReject on rectangles generated by the clip region. Change-Id: I2f55a8e807009887b276a83cde9f53fd5c01199f
* Preliminary Support for region clippingRomain Guy2013-01-141-0/+3
| | | | | | | | | | | | | | | | | | | | Region clipping, using Canvas.clipPath or Canvas.clipRegion, requires a stencil buffer to be always present. In addition, extra wiring is required in JNI and display lists. This change only adds the necessary JNI/C++ APIs and some extra plumbing to start the real work on properly supporting region clipping. A new debug define called DEBUG_CLIP_REGIONS can be used to draw the current clip region. It is off by default, as is region clipping. The default implementation of clipPath() and clipRegion(), now in native, mimics the previous Dalvik implementation to prevent regressions. Change-Id: I7903e7cfd7412b9b9b622566d4dbfce7bdcec00c
* Add a new method for text gamma correctionRomain Guy2012-07-181-3/+0
| | | | | | | | | | | | | | | | | | | 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
* Don't clear the dirty clip flag if it's not appliedRomain Guy2012-07-171-0/+3
| | | | | | Bug #6833979 Change-Id: I0ea78b7f31a557a335de10d910d03b0520029080
* Add shader-based text gamma correctionRomain Guy2012-07-161-0/+3
| | | | | | | | To enable it, the system property ro.hwui.text_gamma_shader must be set to true. For testing, DEBUG_FONT_RENDERER_FORCE_SHADER_GAMMA can be set to 1 in libhwui/Debug.h. Change-Id: If345c6b71b67ecf1ef2e8847b71f30f3ef251a27
* Reduce logsRomain Guy2012-02-221-1/+1
| | | | Change-Id: I2768972ec62f4d3ad800a4d7a4c44307a2fa0105
* Disable debugging code in the font rendererRomain Guy2012-02-021-0/+3
| | | | Change-Id: I92463057ff4ae712bb25789db1667ff1ecfd389f
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-1/+1
| | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
* Use high precision iterators on specific GPUsRomain Guy2011-08-011-0/+3
| | | | | | Bug #5098359 Change-Id: I52ee8c7b4c9e8d4c7bedb684eaf7bef6c44c74b9
* Trim OpenGLRenderer's memory usage whenever possibleRomain Guy2011-07-181-0/+3
| | | | Change-Id: I9225077184f374b1a43300add15cc1d5b6869d1c
* Correctly implement the CLEAR xfermode.Romain Guy2011-05-261-0/+2
| | | | | | | | | The previous implementation was using glBlendFunc with the parameters GL_ZERO/GL_ZERO which doesn't work for text, paths and other alpha sources (anti-aliasing.) The correct implementation is GL_ZERO/ GL_ONE_MINUS_SRC_ALPHA. Change-Id: I4cca65e57b6a37bbf5a41d382cb0648ee8e11e79
* Use the correct API to query system properties.Romain Guy2011-03-231-2/+2
| | | | Change-Id: Ie120dee0e24959d4db3fdb0100b6d8fe7fe46cdb
* Log only 1 line per process when using OpenGLRenderer.Romain Guy2011-01-211-0/+9
| | | | Change-Id: Idbdd6b84f31301e58ed53e0d50fd61fece192dfa
* Remove unnecessary code.Romain Guy2011-01-201-3/+0
| | | | Change-Id: I83eba3406c26a4028af08b4d4c95ecd02803e75a
* Add rounded rects and circles support to OpenGLRenderer.Romain Guy2011-01-191-0/+3
| | | | Change-Id: I6cedf2b495d58de7c0437096809fa9e4518a1b8c
* Fix 9patch rendering in ExpandableListView.Romain Guy2011-01-161-0/+4
| | | | Change-Id: I60843d61a40b0cb7dd09923cb4489a5a76f20486
* Add debug logs for display lists.Romain Guy2011-01-131-0/+3
| | | | Change-Id: I7bae8fd96e9eccb51f29f73e4069b4d3e6bdbdd7
* Add logging to the new layers API.Romain Guy2011-01-121-0/+3
| | | | Change-Id: I78b9426eb17de3e775aca9fafe4a50bd9c0785c4
* Don't render degenerate triangles in 9patches.Romain Guy2010-12-031-0/+3
| | | | | | Bug #3251983 Change-Id: Ib0b38a7b8111542372f4c4c106b6321c26fe4ad4
* Move all debug flags in a single place.Romain Guy2010-11-101-0/+44
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