summaryrefslogtreecommitdiffstats
path: root/libs/hwui/DeferredDisplayList.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix roundrect clipping / blending orderingChris Craik2015-06-121-1/+3
| | | | | | | | | bug:21803918 Also, don't consider rr clipped ops opaque, and put stage checking behind a debug flag. Change-Id: I9304ae571337a7cf835524682d1a590a21d30fa4
* Use path intersection instead of saveLayer+mesh to mask projected ripplesChris Craik2015-05-261-0/+1
| | | | | | | | | | | | | | | | | | | | | bug:14297149 SaveLayer's performance cost is high, and proportional to the surface being projected onto. Since ripples (even unbounded ones) are now always projected to the arbitrary background content behind them, this cost is especially important to avoid. This removes the last semi-secret, saveLayer from the projected ripple implementation. Also fixes the HW test app to correctly demonstrate this projection masking behavior. Additionaly, alters PathTessellator to gracefully handle counter-clockwise paths, and simplifies the work done by ShadowTessellator to ensure all of its paths are counterclockwise. Change-Id: Ibe9e12812bd10a774e20b1d444a140c368cbba8c
* Cleanup propertiesChris Craik2015-05-051-1/+2
| | | | | | | | | | | | bug:19967854 Separate properties from Caches, into static, RenderThread-only class. Also rewrites the means for java to set properties to correctly handle threading, and adds an override for profile bars so that SysUi doesn't clutter the screen with them. Change-Id: I6e21a96065f52b9ecc49d1a126244804ba106fa9
* Remove concept of layer alpha overrideChris Craik2015-04-281-3/+1
| | | | | bug:19412691 Change-Id: I9e150fe4a1b2c0cf140519a33c02fd4771ef1c50
* Remove DisplayListLogBufferChris Craik2015-01-211-6/+0
| | | | Change-Id: I001832fc444b6d532f4a382e0a31cc1d8956dbd8
* Add overrides and switch to nullptr keyword for all filesChris Craik2015-01-051-13/+14
| | | | | | | Adds remaining missing overrides and nullptr usages, missed due to an extreme failure in tool usage. Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
* resolved conflicts for merge of fd461ede to masterChris Craik2014-12-171-5/+6
|\ | | | | | | Change-Id: I36f263c7e6d96355dd8a2c3565581b9a983ae481
| * am 93492d1a: am c748832f: Merge "Revert overdraw avoidance visualization ↵Chris Craik2014-12-171-5/+6
| |\ | | | | | | | | | | | | | | | | | | change" into lmp-mr1-dev * commit '93492d1a478770783abab764855c8d47e0264f71': Revert overdraw avoidance visualization change
| | * Revert overdraw avoidance visualization changeChris Craik2014-12-171-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | bug:18787324 Partial revert of 23d307c8d88f4a3849163b9e5b7cd11d0d4f372c. Change-Id: Ic8b91b046707fc5b8fa53c35ea7b37bb19c3c943
| * | Fix styleJohn Reck2014-12-121-6/+6
| | | | | | | | | | | | Change-Id: I7227b0eac126bf470ed50249a7809b845872983b
* | | Revert "resolved conflicts for merge of 220c3f4f to master"Andreas Gampe2014-11-221-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Reverted as hwui doesn't agree. This reverts commit 8a902d9f24e83c87b054adb5836b4a5b8a257be9. Change-Id: I109e7b02bee2921e2155ded6df36f52e6f574b5a
* | | resolved conflicts for merge of 220c3f4f to masterAndreas Gampe2014-11-211-7/+7
|\ \ \ | |/ / | | | | | | Change-Id: I37ecce8fddecdff82b0eace16f1ee75152f7171e
| * | resolved conflicts for merge of 99377df1 to lmp-mr1-dev-plus-aospAndreas Gampe2014-11-211-7/+7
| |\ \ | | | | | | | | | | | | Change-Id: I3a98f55832ac447b1ed0dd129c7a93d088025943
| | * | Frameworks/base: Unused parameters in hwuiAndreas Gampe2014-11-211-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove Clang cutout for unused parameters. Fix warnings. Remove Clang cutout for deprecated Skia function usage. Has been fixed in the L push. Change-Id: I7ea073ff67127cc1e14e798b655e2c50615fe8e7
| * | | resolved conflicts for merge of 1d03b816 to lmp-mr1-dev-plus-aospAndreas Gampe2014-11-101-3/+1
| |\ \ \ | | |/ / | | | / | | |/ | |/| Change-Id: Ib673768fe5fc03615626ef4b10590e5317f22172
| | * Frameworks/base: Wall Werror in libs/hwuiAndreas Gampe2014-11-101-3/+1
| | | | | | | | | | | | | | | | | | Turn on -Wall -Werror in libs/hwui. Fix errors. Change-Id: I74962d08c889712dacbd0d86d6760fc10802b6bd
* | | resolved conflicts for merge of 1d03b816 to lmp-mr1-dev-plus-aospAndreas Gampe2014-11-101-3/+1
| | | | | | | | | | | | | | | | | | (cherry picked from commit 1272887050a269d6d506b42099c2857847ad100b) Change-Id: Ib673768fe5fc03615626ef4b10590e5317f22172
* | | Remove status return from all uirenderer::Renderer functionsTom Hudson2014-11-041-25/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 c7c8b069: Merge "Cleanup debug options" into lmp-mr1-dev automerge: ↵John Reck2014-10-281-6/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | b0aeaad automerge: 49a01fc * commit 'c7c8b069407236bcc04c086912c73002d48419ef': Cleanup debug options
| * | Cleanup debug optionsJohn Reck2014-10-271-6/+5
| |/ | | | | | | | | | | Bug: 18138852 Bug: 18065434 Change-Id: Ibb07b73b147c2a8b287fe8aee3f6624582f21b00
* | Refactor HWUI to better handle Canvas DrawFilters.Derek Sollenberger2014-10-171-20/+0
|/ | | | | | | | | | | | | | | | | | | 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
* No-fail invokeFunctorJohn Reck2014-06-231-1/+1
| | | | | | | Bug: 15513308 Bug: 15449247 Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c
* Merge "Inspect SkShader to determine hw shader."Chris Craik2014-05-231-1/+5
|\
| * Inspect SkShader to determine hw shader.Leon Scroggins III2014-05-221-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Round rect outline clippingChris Craik2014-05-151-5/+6
|/ | | | Change-Id: Iee9cf4f719f6f1917507b69189ad114fa365917b
* Avoid caching shadow properties in Java & HWUI.Derek Sollenberger2014-05-071-1/+1
| | | | | bug: 10650594 Change-Id: I6f57df002710bb0567ed7e53fc0bfe96cfd504b8
* Removing SkiaColorFilter and inspecting the native object directly.Derek Sollenberger2014-02-071-1/+5
| | | | | bug: 10650594 Change-Id: I4fcf66d008765afa0e35d011f58bc792183cb74f
* Merge "Disallow negative scale matrices in merged Bitmap drawing" into klp-devChris Craik2013-09-181-0/+5
|\
| * Disallow negative scale matrices in merged Bitmap drawingChris Craik2013-09-161-0/+5
| | | | | | | | | | | | bug:10622962 Change-Id: I55ac18ad56b53dc9e6e6ea14cd3ec4bdafa98ac3
* | Fix merged operation clippingChris Craik2013-09-131-1/+1
|/ | | | | | | | bug:10745870 Missing 'const' meant MergingDrawBatch would never clip anything. Change-Id: Ia6367eff94cf5f437efafbc3ba7f0da102ffd956
* Move DeferredDisplayState out of opsChris Craik2013-09-121-55/+76
| | | | | | | | | | | | | | 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
* Initialize MergingDrawBatch clip with viewport boundsChris Craik2013-06-211-3/+6
| | | | | | | | | | This allows merged, clipped operations to behave correctly within a savelayer, even if the base viewport has a large offset. Additionally, disregard opaqueness when within a complexclip/savelayer, as the coverage can't be trusted. Change-Id: Ic908b82a4bb410bc7fac1b4295f4874ed166efc5
* Merge "Better handle op size edge cases"Chris Craik2013-06-171-0/+1
|\
| * Better handle op size edge casesChris Craik2013-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | bug:9464358 Previously, empty and unknown sized ops are assumed to fully cover their clip. This is now corrected such that empty sized ops are pre-rejected before defer. Additionally, unknown sized ops disable overdraw avoidance. Change-Id: Icf2ce24f98be5ea6299e24ffcf826790373564a1
* | Fix clip merging behaviorChris Craik2013-06-141-18/+39
|/ | | | | | | Previously, a new op with a clipped side could be added to a MergingDrawBatch without considering the batch's current bounds. Change-Id: I1b873ecf821bad7cda6630c3f311edd90ac5cc8c
* Reset batching state when overlap batch deletion occursChris Craik2013-06-131-3/+7
| | | | Change-Id: Ifdbee9baaa734e27d15d2b54aa3b3abfffbce1e9
* Overdraw avoidance and merging of clipped opsChris Craik2013-06-121-35/+116
| | | | | | | | | | | | | | | | | bug:8951267 If an opaque op, or group of opaque ops covers the invalidate region, skip draw operations that precede it. Clipped operations may now be merged, but only if they share a clipRect - this is a very case for e.g. ListView, where all background elements may now be a part of the same MergingDrawBatch. It is this more aggressive merging that groups together clipped background elements in the ListView case, enabling the overdraw avoidance skipping the window background. Change-Id: Ib0961977e272c5ac37f59e4c67d828467422d259
* Merge "Merge scaled bitmaps with translated bitmaps"Romain Guy2013-05-221-1/+4
|\
| * Merge scaled bitmaps with translated bitmapsRomain Guy2013-05-211-1/+4
| | | | | | | | Change-Id: I03089f48f97b69fcb4a0171984d3ff548d41c4a8
* | Use individual glyph positions to determine text bounds.Chris Craik2013-05-211-4/+4
|/ | | | | | | | | | | | | | | bug:8766924 Previously text bounds were calculated to be from 0 to totalAdvance in the X, and from the font's top to bottom. These are incorrect, especially in light of the font fallback mechanism. Now, we calculate the bounds of the text as we layout each glyph. Since these are much tighter bounds in the common case, this significantly reduces the amount of clipping required (which in turn enables more aggressive text merging). Change-Id: I172e5466bf5975bf837af894a9964c41db538746
* Fix off by one error in log trackingChris Craik2013-05-091-2/+2
| | | | | | | | | bug:8875715 Additionally moves op logging before the op is executed, to print correctly, in pre-order traversal Change-Id: I4e9566261f8363c73739d183e6d82b854f72ffad
* Draw Operation mergingChris Craik2013-04-151-52/+207
| | | | | | | | | | | | | | | | | | 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
* Introduce PixelBuffer API to enable PBOsRomain Guy2013-04-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | 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
* Correct save/restore match upChris Craik2013-04-031-1/+6
| | | | | | | | | bug:8480642 With the additional save/restore around the operations in flush, the stored restore batches weren't matching up to the correct saves. Change-Id: I2f48f19009bd97289b6973283f43dc8d3e35affd
* Fix issues related to saveLayer/restore deferralChris Craik2013-03-281-8/+17
| | | | | | | | | | | | | bug:8464795 Changes drawModifiers and alpha to be restored for all operations, since saveLayer/restore use these values, not just draw operations Also forces a renderer state restoration before a deferred restore op is played back, in case it is associated with a saveLayer that doesn't have the save_clip flag set Change-Id: I9da5d44fefbfffdee164c98f4f139843dacf85df
* Restore final canvas state after deferred flushChris Craik2013-03-221-1/+6
| | | | | | | | | | | | | | bug:8450062 - Fixes overdraw indication with DeferredDisplayList - Fixes drawHardwareLayer called after flush Additionally changes drawLayer to pass its paint to native via setLayerPaint Wrap flush in save/restore so that reordering doesn't affect final transform Change-Id: I08befa42c28500da6387699eefd4be28aedf9f4c
* Update snapshot upon saveLayer deferralChris Craik2013-03-201-3/+3
| | | | | | | | | | | | bug:8409891 In order to defer fbo-targetting saveLayer operations, it's necessary to update the snapshot at defer time so that deferred display state (namely, clip and transform) are fbo relative. Re-enables deferring, as the issues with saveLayer are fixed. Change-Id: I74b0779bc732675c747208f0757c3ea85f6dfbed
* Merge "Use snapshot alpha for layers" into jb-mr2-devChris Craik2013-03-201-1/+1
|\
| * Use snapshot alpha for layersChris Craik2013-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* | Merge all shapes/paths caches to PathCacheRomain Guy2013-03-181-0/+2
| | | | | | | | | | | | | | | | | | This change will greatly simplify the multi-threading of all shape types. This change also uses PathTessellator to render convex paths. Change-Id: I4e65bc95c9d24ecae2183b72204de5c2dfb6ada4