summaryrefslogtreecommitdiffstats
path: root/libs/hwui/DisplayListRenderer.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename native DisplayListRenderer to DisplayListCanvasChris Craik2015-04-201-390/+0
| | | | Change-Id: I33e6f8cc85da1e7da7ff7bf18d4ebde64222067a
* Revert "A bunch more cleanups"John Reck2015-04-171-1/+1
| | | | | | This reverts commit c294d128d03bc9a9982b273a82516c04583438cc. Change-Id: Id1ebb236950f7c36c6d86e1dd95566d3a200748d
* Revert "Remove Bitmap#getSkBitmap"John Reck2015-04-171-2/+2
| | | | | | This reverts commit 4bd981ec533a65e8dee053a0a709b484770b0a76. Change-Id: I5c92cd955c6e70e197dc5cbc5dfeed8369a24a31
* Remove Bitmap#getSkBitmapJohn Reck2015-04-151-2/+2
| | | | Change-Id: Ifb9047b426122d3e5a445eb7a0eb3fce38dedf27
* A bunch more cleanupsJohn Reck2015-04-141-1/+1
| | | | | | | | Switch a few places to using android::canvas instead of SkCanvas as well which eliminated some JNI Change-Id: I8f98b56442a06362b82b984cd1bd3a92398d8dbc
* Fix DrawFilter's usage in HWUI.Derek Sollenberger2015-03-251-1/+2
| | | | | | | | Also add additional compile time checks to ensure that the Java and Skia APIs remain in sync. bug:19890753 Change-Id: I8503cacf2859307e3f480a78603f9f05901b58cc
* Refactor DisplayList path caching.Derek Sollenberger2015-03-131-15/+4
| | | | | | | | | | | This removes dependence on SkPath ptrs that HWUI does not control the lifecycle of. This clears up some errors where the paths are not generated from Java, but rather the Skia test suites. Cherry-pick of a change that originally landed in master-skia and is dependent on a skia merge (ag/655422). Change-Id: I41b9797a2b0af5d6b4ea51891565469d4f1d832d
* Fix bug, change crashes to warningsTom Hudson2015-03-051-1/+1
| | | | | | | Improve behavior when we get a call to draw 0 points. Replace one ALWAYS_FATAL statements with noop. Change-Id: I864b7a9633dfa3dc6eefa403beca4cc7ae14074f
* Fix glop rendering within unclipped saveLayersChris Craik2015-02-271-1/+1
| | | | | | | | | bug:19541881 Additionally, clean up GlopBuilders and rename onGetSnapshot() for clarity Change-Id: I0303e4cd61eef87cf80af2d968c4aa67193cd008
* Remove renderer abstract classChris Craik2015-02-251-1/+0
| | | | | | | No longer needed, allowing vast majority of methods on OpenGLRenderer to be non-virtual. Change-Id: I8a6ee042b95050dc666887579ef4e1c7a8f9b33b
* Create proxy between Skia's SkCanvas and the framework Canvas.Derek Sollenberger2015-01-301-4/+4
| | | | | | | | This enables Picture.java to be replayed into HWUI in addition to extending the Skia testing suite to HWUI. Bug: 19011232 Change-Id: Id27ac03eec817b0784763e62ab8413a07b3b8cb2
* Rename Canvas::getSkCanvas to Canvas::asSkCanvasDerek Sollenberger2015-01-291-1/+1
| | | | Change-Id: I967a45698d382e54eaa5ff64fa8909ff00908650
* Remove DisplayListLogBufferChris Craik2015-01-211-1/+0
| | | | Change-Id: I001832fc444b6d532f4a382e0a31cc1d8956dbd8
* Move CanvasJohn Reck2015-01-201-2/+1
| | | | Change-Id: I83d557af30fc2d5c69d06eedc0f4d52ac41c4210
* Update HWUI to store its own SkBitmap objectsDerek Sollenberger2015-01-091-11/+3
| | | | | | | | | | | This enables us to... 1) simplify the lifecycle/ownership between Java and HWUI 2) remove DisplayListRenderer::drawBitmapData and associated logic 3) track pixel lifecycle using standard SkPixelRef refcounting 4) Remove uncessary calls to ref/unref the bitmap's pixels and colorTable Change-Id: I3c95078da20995444f6388a029414280fd654318
* Add overrides and switch to nullptr keyword for all filesChris Craik2015-01-051-48/+48
| | | | | | | Adds remaining missing overrides and nullptr usages, missed due to an extreme failure in tool usage. Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
* Make DisplayListRenderer inherit from Canvas, merge JNITom Hudson2015-01-051-82/+135
| | | | | | | | | | | | | Incrementally unify the upper layers for Skia and HWUI. Remove redundant code from GLES20Canvas.java; instead use inherited mNativeCanvasWrapper and superclass method definitions. Moves some unrelated SkPaint utility functions from Renderer to new utils/PaintUtils. bug: 15672762 Change-Id: I4ddd4214b8e9eeb95289d054ef423f2542bb5fa5
* Cleanup various clang warnings, use unique_ptrs in several placesChris Craik2014-12-231-19/+26
| | | | Change-Id: I347904b25e51fcc7de14b1e72f1acd0f6ba26f3f
* 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