summaryrefslogtreecommitdiffstats
path: root/libs/hwui/DisplayListRenderer.h
Commit message (Collapse)AuthorAgeFilesLines
* Add overrides and switch to nullptr keywordChris Craik2014-12-221-52/+55
| | | | | | | | Changes generated with clang-modernize. Additionally, fixed some struct-vs-class usage to make clang happy. Change-Id: Ic6ef2427401ff1e794d26f21f7b44868fc75fb72
* Revert "Add a way to override Xfermode"Chris Craik2014-11-211-21/+3
| | | | | | | | | | Feature no longer needed. bug:18448377 This reverts commit c495e611b9fa1fc6b47a647c714bbbf94dd63461. Change-Id: Ia3e37f06953ffd81ca3fac367ee790d26b1b5d29
* Add a way to override XfermodeRob Tsuk2014-11-121-3/+21
| | | | | | | | Add a non-public API to Canvas/GLES20Canvas to provide a way to draw the touch ripple animation without using a save layer. Bug: 18226391 Change-Id: I6f8fb8938505e976892c4e14f6f864362c43e73c
* Fix DisplayListRenderer breakageJohn Reck2014-11-071-0/+1
| | | | Change-Id: I30babebd2b50efe6830be466209341057601544f
* resolve merge conflicts of cabf8a7 to master.John Reck2014-11-071-1/+2
|\ | | | | | | Change-Id: If0ca1c37d05f5dc471d88a3bf158dd68a1880bbf
| * Merge "Fix wrong-thread issue" into lmp-mr1-devJohn Reck2014-11-071-1/+2
| |\
| | * Fix wrong-thread issueJohn Reck2014-11-071-1/+2
| | | | | | | | | | | | | | | | | | Bug: 18259560 Change-Id: Ic63a86efba9c86f21defac0695a73db8b09ae284
* | | resolved conflicts for merge of be70c771 to masterJohn Reck2014-11-061-5/+6
|\ \ \ | |/ / | | | | | | Change-Id: I469905bef7361c18aab725778694567d1987c06d
| * | Yank ResourceCache out of CachesJohn Reck2014-11-061-5/+6
| |/ | | | | | | | | | | | | | | | | | | | | Bug: 17947547 Pull the ResourceCache (aka, ref-counting side channel) out of Caches so that DisplayListRenderer doesn't use Caches, avoiding the risk of instantiating Caches on the wrong thread or without a GL context Change-Id: I7d63b70b3b0a0163308c5dedd6ef255eadebe8fd
* | Replace StatefulBaseRenderer inheritance with CanvasState memberTom Hudson2014-11-041-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | Incrementally disentangles DisplayListRenderer and OpenGLRenderer. Introduces abstract CanvasStateClient class to share three functions between the two. Design doc at https://docs.google.com/a/google.com/document/d/1PY1JF7AfPEF2UOUAnETS5j_4_tnJShTAMExvpCJfP8o/edit?usp=sharing. BUG:15672762 R=djsollen@google.com,ccraik@google.com,jreck@google.com Change-Id: Ic9fdffe18808e7d921ad06d01ea1ca25b2ad6f23
* | Remove status return from all uirenderer::Renderer functionsTom Hudson2014-11-041-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the interface closer to android::Canvas. The only use of return values was in the OpenGLRenderer subclass; that is replaced with an internal dirty flag: returned from finish(), checked by CanvasContext. This is part of a series of CLs to refactor the Graphics JNI bindings. BUG:15672762 R=djsollen@google.com,ccraik@google.com Change-Id: Ifd533eb8839a254b0d3a5d04fc5a2905afdfc89e
* | am e05575e9: am a8d83d63: Merge "Layer changes" into lmp-mr1-dev automerge: ↵John Reck2014-10-311-6/+0
|\ \ | |/ | | | | | | | | | | a51fba0 * commit 'e05575e9c36850d8cfe49396ac9a1372511b12bf': Layer changes
| * Layer changesJohn Reck2014-10-311-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 17208461 * Switch Layer to be VirtualLightRefBase instead of Caches' side-channel ref-counting * Include active layers in gfxinfo dump * Run gfxinfo dump on the correct thread * Dump gfxinfo on Layer creation failure Change-Id: I28d195699e2334518e215ab28c7a17355aee9678
* | Refactor HWUI to better handle Canvas DrawFilters.Derek Sollenberger2014-10-171-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, this CL removes the need to decompose the DrawFilters in Java and instead passes the SkDrawFilter to HWUI directly. This also allows the removal of duplicated logic between HWUI and other Canvas implementations regarding Paint filter levels. Second, the DrawFilter is now stored in the DisplayListRenderer where we apply it to every paint BEFORE it is stored in the DisplayList. This eliminates the need to filter all Paints on playback and removes additional complexity at playback. Finally, as a result of storing the filtered paint we can now do a better job caching the paints. This takes advantage of recent changes in Skia to quickly enable quick hashing and comparison of paint objects. Change-Id: Iec507a2d894827975cc4f1d22241542bb0534b4e
* | Clean up physical couplingTom Hudson2014-10-151-2/+5
| | | | | | | | | | | | | | | | Narrow the use of #include directives in hwui, replacing with forward declarations where straightforward. Speeds compiles; doesn't do any restructuring of code. Change-Id: Icac2baffb5896f55d8c6718e9bd9d4bfa02d3ca0
* | am 99e9b12f: am d2420d39: am ac980443: Merge "Use RenderThread for ↵Jorim Jaggi2014-09-161-0/+4
|\ \ | |/ | | | | | | | | | | navigation bar ripples" into lmp-dev * commit '99e9b12fbe444414f7e4fd9a18aa40fee7bf2f1f': Use RenderThread for navigation bar ripples
| * Use RenderThread for navigation bar ripplesJorim Jaggi2014-09-161-0/+4
| | | | | | | | | | Bug: 17506181 Change-Id: Icf3b80f8c4bc29fe85313381d4019dda3ef85ea9
| * Merge "DO NOT MERGE Copy shaders" into lmp-devJohn Reck2014-08-261-4/+17
| |\ |/ /
| * DO NOT MERGE Copy shadersJohn Reck2014-08-251-4/+17
| | | | | | | | | | | | Bug: 16733996 Change-Id: I84afc1b24a23dd6ddf5ab48fb2bfcbe779f8d3e3
* | Create z reordering boundaries around dispatchDrawChris Craik2014-08-251-10/+21
|/ | | | | | | | | | bug:16012254 This means rendernodes with a Z will no longer be drawn at the end of their parent's DisplayList, but at the end of the associated reorder region (DisplayListData::Chunk). Change-Id: Ia033fee9d9a4db567b2a8d5e90fc57a4d0a64544
* Fix ripples projecting to scrolled viewChris Craik2014-08-121-4/+6
| | | | | | | | | | | | | bug:16873774 1) Fix projectionReceiveIndex, which could in some cases point at translate/restore ops. 2) Use background translateX / translateY for projected RenderNodes. This makes them match background position, and thus properly account for scroll. Change-Id: Idbd5700858fd67c5abea0270a1012952fe09ac22
* Move bitmap transforms out of bitmap opsChris Craik2014-08-061-6/+2
| | | | | | | | | | bug:11359533 This allows us to deduplicate a lot between the two ops, and fixes the shader coordinate space for the left,top argument drawBitmap to match software. Change-Id: I53da05af9ee74c74e9e70b4ab8053190ca220b16
* Add accessibility text contrast settingChris Craik2014-07-161-3/+13
| | | | | | | | | | | b/14624452 Adds a feature which draws all text (in the HW accelerated standard path) in a high contrast mode. Text is drawn at full alpha, and either white or black (depending on its original color) with a starkly contrasted outline beneath it. Change-Id: I943f624b6367de35367cced3b2a8298f2bc62377
* Remove isRecording() method from renderersChris Craik2014-06-271-2/+0
| | | | | | | DisplayListRenderer is all that's accessed from java, and is entirely separate from OpenGLRenderer now. Change-Id: Ie733be71520c13fdb55dfe3522bb445ae2b50ac1
* No-fail invokeFunctorJohn Reck2014-06-231-10/+8
| | | | | | | Bug: 15513308 Bug: 15449247 Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c
* Update 'DisplayList' vs 'RenderNode' naming in several placesChris Craik2014-06-231-2/+1
| | | | Change-Id: I635c6627d098b661fb9b0ba1bd42fa6d7277d287
* am 8632b85b: Merge "Fix issues around GL on incorrect thread" into ↵Chris Craik2014-06-051-0/+5
|\ | | | | | | | | | | | | lmp-preview-dev * commit '8632b85b3ceca1b64ca37843ffd87bc10f4ae72f': Fix issues around GL on incorrect thread
| * Fix issues around GL on incorrect threadChris Craik2014-06-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | bug:15416165 bug:15414673 DisplayListRenderer must override these callbacks from StatefulBaseRenderer, since the super implementations call GL. Eventually, we'll just have DisplayListRenderer inherit from StatefulBaseRenderer directly. Change-Id: I7b20aa0ac6cae3bf6c6969c63bf9ba98ab2831ff
| * DO NOT MERGE Inspect SkShader to determine hw shader.Leon Scroggins III2014-05-231-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cherry-pick of Iaa7189178bda1c55f96da044d2a9fa602ba36034 Instead of duplicating internal info about SkShader, inspect the SkShader installed on the SkPaint. core/java/android/view/GLES20Canvas.java: Remove setupModifiers, nResetModifiers, and nSetupShader. core/jni/android/graphics/Shader.cpp: Remove calls to create/destroy the (previously) attached SkiaShader. core/jni/android_view_GLES20Canvas.cpp: Remove native code for setupShader and resetModifiers. graphics/java/android/graphics/BitmapShader.java: graphics/java/android/graphics/ComposeShader.java: graphics/java/android/graphics/LinearGradient.java: graphics/java/android/graphics/RadialGradient.java: graphics/java/android/graphics/Shader.java: graphics/java/android/graphics/SweepGradient.java: Remove code keeping track of native SkiaShader. libs/hwui/Caches.h: Include Extensions.h. libs/hwui/DeferredDisplayList.cpp: Compare shaders on the paint, instead of on DrawModifiers. libs/hwui/DisplayList.cpp: libs/hwui/DisplayList.h: Remove vector of SkiaShaders. libs/hwui/DisplayListOp.h: Access the SkShader on mPaint. Remove SetupShaderOp and ResetShaderOp. libs/hwui/DisplayListRenderer.cpp: libs/hwui/DisplayListRenderer.h: Remove resetShader, setupShader, refShader, and mShaderMap. libs/hwui/FontRenderer.cpp: Pass SkShader to setupDrawShader and setupDrawShaderUniforms. libs/hwui/OpenGLRenderer.cpp: libs/hwui/OpenGLRenderer.h: Add LayerShader, a class inheriting from SkShader, to mimic the behavior of SkiaLayerShader. Unlike SkiaLayerShader, it can be set on the SkPaint so it can be inspected later. Set a LayerShader instead of a SkiaLayerShader. setupDrawShader and setupDrawShaderUniforms now inspect an SkShader passed in. Inspect SkShader instead of mDrawModifiers.mShader. Remove resetShader and setupShader. setupDrawColorUniforms now takes a boolean indicating whether there is a shader. Add an inline function for accessing the SkShader on an SkPaint. In setupDrawBlending(Layer*, bool), do not check the shader (which will never be set), but do check whether the color filter may change the alpha (newly fixed behavior). In setupDrawBlending(SkPaint, ...), check the SkShader and whether the color filter affects alpha (the latter is new behavior). libs/hwui/Renderer.h: Remove pure virtual functions setupShader and resetShader. libs/hwui/ResourceCache.cpp: libs/hwui/ResourceCache.h: Remove functions for refing/unrefing shaders. libs/hwui/SkiaShader.cpp: libs/hwui/SkiaShader.h: Much of this code was redundant and has been removed. Convert structs into class with nothing but static functions for calling describe/setupProgram. libs/hwui/TextureCache.cpp: libs/hwui/TextureCache.h: Use the SkPixelRef as the key to the bitmap Lru cache, since shader inspection will provide a different SkBitmap pointer (though it will hold the correct SkPixelRef with the correct generation ID). tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java: tests/CanvasCompare/src/com/android/test/hwuicompare/ResourceModifiers.java: Update manual test to have more shaders: radial, sweep, compose, invalid compose. BUG:10650594 Change-Id: I2e7182b3fc28268e7ca82fac6780540b6b45365c
* | Update HWUI matrix APIDerek Sollenberger2014-05-291-14/+3
| | | | | | | | | | | | | | 1. more closely mirror Skia API by using const ref instead of ptrs 2. store SkMatrix in the drawOp instead of the linear allocation heap Change-Id: I4b9f6f76b9f7d19325e29303d27b793679fd4823
* | Merge "Inspect SkShader to determine hw shader."Chris Craik2014-05-231-19/+0
|\ \ | |/ |/|
| * Inspect SkShader to determine hw shader.Leon Scroggins III2014-05-221-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of duplicating internal info about SkShader, inspect the SkShader installed on the SkPaint. core/java/android/view/GLES20Canvas.java: Remove setupModifiers, nResetModifiers, and nSetupShader. core/jni/android/graphics/Shader.cpp: Remove calls to create/destroy the (previously) attached SkiaShader. core/jni/android_view_GLES20Canvas.cpp: Remove native code for setupShader and resetModifiers. graphics/java/android/graphics/BitmapShader.java: graphics/java/android/graphics/ComposeShader.java: graphics/java/android/graphics/LinearGradient.java: graphics/java/android/graphics/RadialGradient.java: graphics/java/android/graphics/Shader.java: graphics/java/android/graphics/SweepGradient.java: Remove code keeping track of native SkiaShader. libs/hwui/Caches.h: Include Extensions.h. libs/hwui/DeferredDisplayList.cpp: Compare shaders on the paint, instead of on DrawModifiers. libs/hwui/DisplayList.cpp: libs/hwui/DisplayList.h: Remove vector of SkiaShaders. libs/hwui/DisplayListOp.h: Access the SkShader on mPaint. Remove SetupShaderOp and ResetShaderOp. libs/hwui/DisplayListRenderer.cpp: libs/hwui/DisplayListRenderer.h: Remove resetShader, setupShader, refShader, and mShaderMap. libs/hwui/FontRenderer.cpp: Pass SkShader to setupDrawShader and setupDrawShaderUniforms. libs/hwui/OpenGLRenderer.cpp: libs/hwui/OpenGLRenderer.h: Add LayerShader, a class inheriting from SkShader, to mimic the behavior of SkiaLayerShader. Unlike SkiaLayerShader, it can be set on the SkPaint so it can be inspected later. Set a LayerShader instead of a SkiaLayerShader. setupDrawShader and setupDrawShaderUniforms now inspect an SkShader passed in. Inspect SkShader instead of mDrawModifiers.mShader. Remove resetShader and setupShader. setupDrawColorUniforms now takes a boolean indicating whether there is a shader. Add an inline function for accessing the SkShader on an SkPaint. In setupDrawBlending(Layer*, bool), do not check the shader (which will never be set), but do check whether the color filter may change the alpha (newly fixed behavior). In setupDrawBlending(SkPaint, ...), check the SkShader and whether the color filter affects alpha (the latter is new behavior). libs/hwui/Renderer.h: Remove pure virtual functions setupShader and resetShader. libs/hwui/ResourceCache.cpp: libs/hwui/ResourceCache.h: Remove functions for refing/unrefing shaders. libs/hwui/SkiaShader.cpp: libs/hwui/SkiaShader.h: Much of this code was redundant and has been removed. Convert structs into class with nothing but static functions for calling describe/setupProgram. libs/hwui/TextureCache.cpp: libs/hwui/TextureCache.h: Use the SkPixelRef as the key to the bitmap Lru cache, since shader inspection will provide a different SkBitmap pointer (though it will hold the correct SkPixelRef with the correct generation ID). tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java: tests/CanvasCompare/src/com/android/test/hwuicompare/ResourceModifiers.java: Update manual test to have more shaders: radial, sweep, compose, invalid compose. BUG:10650594 Change-Id: Iaa7189178bda1c55f96da044d2a9fa602ba36034
* | Define light position (using new lighting spec) in JavaChris Craik2014-05-211-4/+0
|/ | | | | | Also updates the relative shadow strengths. Change-Id: I6cac7275d38df98aea9f0dda463cd7207102986a
* Merge "Avoid caching shadow properties in Java & HWUI."Derek Sollenberger2014-05-081-3/+0
|\
| * Avoid caching shadow properties in Java & HWUI.Derek Sollenberger2014-05-071-3/+0
| | | | | | | | | | bug: 10650594 Change-Id: I6f57df002710bb0567ed7e53fc0bfe96cfd504b8
* | Add CanvasProperty for drawCircleJohn Reck2014-05-021-0/+2
|/ | | | Change-Id: Icbcc030f5033d2094e567d7c519b9d672f2aac1c
* Move RenderNode to own fileJohn Reck2014-03-191-1/+1
| | | | Change-Id: I9380d161fd3ddd7b569c262dd8e7aa0c96151b1e
* Rename DisplayList->RenderNodeJohn Reck2014-03-121-2/+2
| | | | Change-Id: Id42e23c9a1a6eb6eaeafef707ced7fa6887b03d0
* Fix warnings in hwuiChris Craik2014-03-051-2/+2
| | | | Change-Id: I6ad6b78531cc0426dc2ea82a32775f7b0265b5b1
* DisplayList overhaulJohn Reck2014-03-041-87/+13
| | | | Change-Id: I53418d580c98f706e971545cff81b9921c12cc5f
* Removing SkiaColorFilter and inspecting the native object directly.Derek Sollenberger2014-02-071-14/+0
| | | | | bug: 10650594 Change-Id: I4fcf66d008765afa0e35d011f58bc792183cb74f
* Merge "Keep the SkPaint used when creating a layer."Derek Sollenberger2014-02-071-1/+1
|\
| * Keep the SkPaint used when creating a layer.Derek Sollenberger2014-02-071-1/+1
| | | | | | | | | | | | | | | | This will allow us to inspect the paint for thing other than color and xfermode, such as SkColorFilters and SkShaders. bug: 10650594 Change-Id: I2c3ddd07a3966e1e77af34136307e2b59b2898c1
* | Rework and clean up DisplayList projectionChris Craik2014-02-061-2/+0
|/ | | | | | | | | | Move the projection surface to be a property of a DisplayList, set to true for every background drawable. Additionally, handle a projecting view background such that it doesn't try to project onto itself (which is undesirable). Change-Id: Ic70b17474bd87340e80767f8518f73b233419c7a
* Support projection of DisplayLists onto ancestors.Chris Craik2014-01-151-0/+2
| | | | | | | | | | | | | | | For now, ancestor views signal the acceptance of projections with a save(0x20)/restore pair. During the order traversal, each view with the save(0x20) code will collect descendent views with mProjectToContainedVolume (which still needs to be renamed) so that they can be drawn out of order later. - *Temporary* sample code added to HwAccelerationTest. - Note that a projected displaylist must not be clipped. Change-Id: I45c493e845961535b958d59c53e8aff3f8891d9f
* Use const where possible for drawing parametersChris Craik2014-01-031-60/+68
| | | | | | They should never be modified by a Renderer, only read and copied. Change-Id: I9d8d55dca19115ee9dfeb2bb3f092ba2fb327cd4
* Fix isRecording overrideChris Craik2014-01-021-1/+1
| | | | Change-Id: Ie73db838b749c29c6a8480ab67897492b83d337a
* Use const access to snapshot from OpenGLRendererChris Craik2014-01-021-1/+1
| | | | | | Additionally, move clipping methods to StatefulBaseRenderer Change-Id: Iff232bf16fc1ad3b7d89493da6d8915db7bc5e4f
* Move Snapshot management to intermediate StatefulBaseRenderer classChris Craik2014-01-011-22/+47
| | | | | | | | | | | | | | | | | | The eventual goal is for the StatefulBaseRenderer to serve as the common base class between the DisplayListRenderer and OpenGLRenderer. This will separate DisplayList recording, Snapshot stack management, and the GL in OpenGLRenderer. Additionally, avoid sp<> parameters, and use const parameters in several places, with the intent of greatly reducing the surface area where renderer subclasses can modify snapshot stack. Next steps: -move bulk of clipping logic into StatefulBaseRenderer -disable direct snapshot access Change-Id: Ibc3c6747134ec7daf8ea535866239fa73b874390
* Create abstract base class for OpenGLRendererChris Craik2013-12-271-2/+2
| | | | | | | | | | | | This will eventually serve as a base class to allow DisplayListRenderer to split off from OpenGLRenderer, and could eventually support other rendering approaches, such as an SkCanvas/SkPicture. This will also be the main source of (implementation-independent) documentation of the canvas/renderer methods. Change-Id: I52047f338f5cf86a3b0b3002af7154bff5c3c227