summaryrefslogtreecommitdiffstats
path: root/libs/hwui/DisplayList.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix leak of SkPathRefsChris Craik2014-08-081-1/+12
| | | | | | | | | bug:15939479 SkPath objects owned by DisplayListOps weren't being torn down, and thus weren't releasing their SkPathRef innards. Change-Id: I2581e124600a93a399ef3251f456c02ab52839a8
* Add kModeSyncJohn Reck2014-07-241-1/+1
| | | | | | Bug: 16526750 Change-Id: I4c087160e80432739321172fd57880846c8de6e0
* Update 'DisplayList' vs 'RenderNode' naming in several placesChris Craik2014-06-231-4/+4
| | | | Change-Id: I635c6627d098b661fb9b0ba1bd42fa6d7277d287
* Update HWUI matrix APIDerek Sollenberger2014-05-291-1/+0
| | | | | | | 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
* Inspect SkShader to determine hw shader.Leon Scroggins III2014-05-221-2/+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
* Refactor VirtualLightRefBase & JNIJohn Reck2014-05-091-1/+0
| | | | Change-Id: I8e244e7109e59d5be96871b23bb9b1201c7f9eaa
* Add CanvasProperty for drawCircleJohn Reck2014-05-021-0/+8
| | | | Change-Id: Icbcc030f5033d2094e567d7c519b9d672f2aac1c
* Refcount RenderNodeJohn Reck2014-04-071-5/+11
| | | | Change-Id: I7a86db8acc2b78ef33d987a43a119f5933d7d752
* Move RenderNode to own fileJohn Reck2014-03-191-130/+0
| | | | Change-Id: I9380d161fd3ddd7b569c262dd8e7aa0c96151b1e
* Split out RenderPropertiesJohn Reck2014-03-121-391/+8
| | | | Change-Id: Ia9888b4fb2c849d95a8c395cafef2e2294a23aae
* No-op isolatedZVolumen propertyJohn Reck2014-03-121-5/+0
| | | | Change-Id: I7aa474d65a3d12efd4ffb731e07ee42f4d348183
* Rename DisplayList->RenderNodeJohn Reck2014-03-121-4/+4
| | | | Change-Id: Id42e23c9a1a6eb6eaeafef707ced7fa6887b03d0
* Fix orthographic shadows projection, simplify shadow reorderingChris Craik2014-03-121-8/+5
| | | | | | | | | Separate matrix passed to shadow system into two parts, one for transforming the polygon XY points (using the actual draw matrix) and a separate one which respects correct 4x4 3d rotations and translations for determining Z values. Change-Id: I7e30a84774a8709df6b2241e8f51fc5583648fe8
* Draw shadows from casters together if the Z values are similarChris Craik2014-03-051-0/+7
| | | | Change-Id: Ib5d00c83e81d9d4c384685a84988a681da8b4490
* DisplayList overhaulJohn Reck2014-03-041-35/+30
| | | | Change-Id: I53418d580c98f706e971545cff81b9921c12cc5f
* Make outline and shadow APIs publicChris Craik2014-02-181-3/+3
| | | | Change-Id: If40dc27b2fdc41c3ed355bc9029474b1344c1a03
* Merge "Removing SkiaColorFilter and inspecting the native object directly."Derek Sollenberger2014-02-101-2/+0
|\
| * Removing SkiaColorFilter and inspecting the native object directly.Derek Sollenberger2014-02-071-2/+0
| | | | | | | | | | bug: 10650594 Change-Id: I4fcf66d008765afa0e35d011f58bc792183cb74f
* | Add shadow casting / global perspective APIs, hidden for now.Chris Craik2014-02-071-0/+10
| | | | | | | | | | | | Global perspective isn't yet hooked up in rendering. Change-Id: I64ad272ea5dc523505260ce114f0a6bebdcfe9dc
* | Add the clipToOutline by just using the clipPathOpztenghui2014-02-071-0/+5
|/ | | | Change-Id: I6ba23b589e579599d018600d0744be0efe2028c1
* Merge "Rework and clean up DisplayList projection"Chris Craik2014-02-071-3/+11
|\
| * Rework and clean up DisplayList projectionChris Craik2014-02-061-3/+11
| | | | | | | | | | | | | | | | | | | | 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
* | Simplify DisplayList matricesChris Craik2014-02-051-2/+9
|/ | | | | | | Somewhat unifies the ortho/perspecive paths - the property matrix (translate/scale/rotate) is now always a Matrix4. Change-Id: I36e4fe83d1150ee6e4be5f64f34d0fc8d6525cc6
* Add initial hidden outline APIsChris Craik2014-01-301-0/+9
| | | | | | | Background drawable outline usage and drawable outline calculation still to come. Change-Id: I8c7539f1638f86e1f8eb11f4fe49f705f61d58ba
* Update reordering method names, and make 3d reordering API publicChris Craik2014-01-291-6/+6
| | | | | | | | | | IsContainedVolume -> hasIsolatedZVolume conveys that this affects Z ordering of views ProjectToContainedBackground -> ProjectBackwards, since it ended up using its own projection target, separate from the 3d volume bit Change-Id: Ia2cde838cc4da134366fe6ff623290fbd65e50c3
* Remove logging of DisplayList stalenessChris Craik2014-01-271-14/+2
| | | | Change-Id: Ie6b3af3065d4d10ec0bc9b419223d3458d297ea8
* Clear root level reorder lists to prevent accessing stale DisplayListsChris Craik2014-01-241-5/+17
| | | | | | | | | bug:12581401 Adds temporary logging which should log/crash earlier on incorrectly reordering hierarchies. Change-Id: Iee00940718c3cc868161e754aff93cd3b2747094
* Support projection of DisplayLists onto ancestors.Chris Craik2014-01-151-2/+15
| | | | | | | | | | | | | | | 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
* Simplify Z reordering logicChris Craik2014-01-141-4/+6
| | | | Change-Id: I9e36f68d7be5cfd4d69a84a51824cb9a642fe18d
* Add DisplayList bit for projecting onto a contained volumeAlan Viverette2014-01-081-1/+6
| | | | | | Does not handle reordering/translating the projected DisplayList. Change-Id: I6f1ebb2b20b7436c86fe849b35d582fd9c8a8967
* Use const where possible for drawing parametersChris Craik2014-01-031-8/+8
| | | | | | They should never be modified by a Renderer, only read and copied. Change-Id: I9d8d55dca19115ee9dfeb2bb3f092ba2fb327cd4
* Add initial APIs for 3d view manipulation.Chris Craik2013-12-201-2/+5
| | | | Change-Id: I6de00bc577d5b3a1fbc9ca3a3b3668fcfa32b867
* Merge "3d view system!"Chris Craik2013-12-131-37/+94
|\
| * 3d view system!Chris Craik2013-12-121-37/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Unbreak display list debug dumpingJohn Reck2013-12-101-1/+1
|/ | | | Change-Id: I1c6a79f047b29fa60907f6e128cb843a45b88bff
* Move DeferredDisplayState out of opsChris Craik2013-09-121-3/+1
| | | | | | | | | | | | | | bug:9969358 Instead of storing DeferredDisplayState within an op (thus forcing ops to be tied to a single state instance), associate each op with a new state at DeferredDisplayList insertion time. Now, DisplayLists (and the ops within) can be reused in a single DeferredDisplayList draw call, as ops will use different state instances at different points in the frame. Change-Id: I525ab2abe0c3883679f2fa00b219b293e9ec53d9
* Refcount 9-patches and properly handle GC eventsRomain Guy2013-06-261-0/+4
| | | | | | | | | | | | | | | | | This change adds refcounting of Res_png_9patch instances, the native data structure used to represent 9-patches. The Dalvik NinePatch class now holds a native pointer instead of a Dalvik byte[]. This pointer is used whenever we need to draw the 9-patch (software or hardware.) Since we are now tracking garbage collection of NinePatch objects libhwui's PatchCache must keep a list of free blocks in the VBO used to store the meshes. This change also removes unnecessary instances tracking from GLES20DisplayList. Bitmaps and 9-patches are refcounted at the native level and do not need to be tracked by the Dalvik layer. Change-Id: Ib8682d573a538aaf1945f8ec5a9bd5da5d16f74b
* Remove crash workarounds, add loggingChris Craik2013-06-121-4/+5
| | | | | bug:9321162 Change-Id: I748c27f979af1a303be01db29aedcbad6d608c38
* Remove string allocations when creating display listsRomain Guy2013-06-051-1/+6
| | | | Change-Id: Id520db981a3988cb980c8da5dbea8f26ef94989f
* Fix quickReject logic to account for setClipChildren() settingChet Haase2013-04-191-3/+3
| | | | | | | | | | | | | | | | The rendering code optimizes by rejecting drawing operations that lie outside of the bounds of their views. This works in most situations, but breaks down when containers have called setClipChildren(false), because we reject drawing that is outside of that container, but which should be drawn anyway. Fix is to pass in the value of that flag to the DisplayList drawing routines which take that flag into account when deciding whether to quickReject any particular operation. Issue #8659277 animation clipping Change-Id: Ief568e4db01b533a97b3c5ea5ad777c03c0eea71
* Use snapshot alpha for layersChris Craik2013-03-151-2/+0
| | | | | | | | | | | Removes mMultipliedAlpha, using the snapshot alpha for all non-overlapping display list alpha control. Additionally, fixes opacity issues where children of hasOverlappingRendering=false displaylists (both hw layer sublists and other sublists with hasOverlappingRendering=false) Change-Id: I6adc16da855835f9f518f8967628e5d0135c789b
* Fully deferred displaylist replayChris Craik2013-03-151-6/+53
| | | | | | | | | | | | | | | | | | bug:8037003 A recursive drawDisplayList call is now entirely deferred before playing back to the screen and issuing GL commands. This way, the entire stream can be inspected, optimized, and batch work (such as uploading textures) before issuing commands. Additionally, this fixes an issue where operations draw could move across restores corresponding to saveLayer(alpha). Those and other similar cases (such as complex clipping, requiring the stencil) are now treated as batching barriers, with the operations that change renderer state in a way that's difficult to defer are just re-issued at flush time. Change-Id: Ie7348166662a5ad89fb9b1e87558334fb826b01e
* Merge "Prettify display lists logging"Romain Guy2013-02-221-0/+4
|\
| * Prettify display lists loggingRomain Guy2013-02-221-0/+4
| | | | | | | | | | | | This change makes it a lot easier to see the tree structure. Change-Id: I4969abd1eb010f1d529671f8d86dc4c930be24f6
* | Fix clipping and stencil layer issuesChris Craik2013-02-211-1/+2
|/ | | | | | | | | | | | | bug:8235699 Ensure rectangle clipping operations disable deferring when necessary (i.e., when the op might create a non-rect region), including in DisplayList::setViewProperties Additionally, makes clipping with a kUnion always use a region, for consistency with software rendering Change-Id: I6730f1a80250bcf3f91cd4afde646d470a12dbc2
* Expose display list APIsRomain Guy2013-02-191-2/+71
| | | | | | | The exposed APIs are slightly simpler than the full APIs used internally. Only APIs useful to applications are exposed. Change-Id: Ie03014628d40ad5ef63dedbc52ce3def84429d54
* DisplayList draw operation reorderingChris Craik2013-02-151-1/+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
* Move DisplayList to its own cpp fileChris Craik2013-02-141-0/+422
Change-Id: Ic9c1bbf4673ad5c756f3908b2ab7e699edd6a119