History log of /frameworks/base/libs/hwui/DeferredDisplayList.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef8d6f272ae451aaedb0f02249c0f9f0576efdf3 17-Dec-2014 Chris Craik <ccraik@google.com> Revert overdraw avoidance visualization change

bug:18787324

Partial revert of 23d307c8d88f4a3849163b9e5b7cd11d0d4f372c.

Change-Id: Ic8b91b046707fc5b8fa53c35ea7b37bb19c3c943
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
23d307c8d88f4a3849163b9e5b7cd11d0d4f372c 27-Oct-2014 John Reck <jreck@google.com> Cleanup debug options

Bug: 18138852
Bug: 18065434
Change-Id: Ibb07b73b147c2a8b287fe8aee3f6624582f21b00
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
3b20251a355c88193c439f928a84ae69483fb488 23-Jun-2014 John Reck <jreck@google.com> No-fail invokeFunctor

Bug: 15513308
Bug: 15449247

Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
d490aa426090fc358873821b47ef27ead0c97409 23-May-2014 Chris Craik <ccraik@google.com> Merge "Inspect SkShader to determine hw shader."
d1ad5e62fda248c6d185cde3cb6d9f01a223066c 05-May-2014 Leon Scroggins III <scroggo@google.com> Inspect SkShader to determine hw shader.

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
deeda3d337aed1eee218b89a7aba5992ced371f0 06-May-2014 Chris Craik <ccraik@google.com> Round rect outline clipping

Change-Id: Iee9cf4f719f6f1917507b69189ad114fa365917b
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
c29a0a4664a4b9871fadd668b632469a0db240b9 31-Mar-2014 Derek Sollenberger <djsollen@google.com> Avoid caching shadow properties in Java & HWUI.

bug: 10650594
Change-Id: I6f57df002710bb0567ed7e53fc0bfe96cfd504b8
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
76d3a1b8d035d27bc80b0f2fc480a903bd001514 10-Dec-2013 Derek Sollenberger <djsollen@google.com> Removing SkiaColorFilter and inspecting the native object directly.

bug: 10650594
Change-Id: I4fcf66d008765afa0e35d011f58bc792183cb74f
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
a42ceb03cf6a1cbcd9f526afb02d806b2c200ee3 18-Sep-2013 Chris Craik <ccraik@google.com> Merge "Disallow negative scale matrices in merged Bitmap drawing" into klp-dev
d965bc5823d878a3fd056b8a95fb4eb578ed3fe4 16-Sep-2013 Chris Craik <ccraik@google.com> Disallow negative scale matrices in merged Bitmap drawing

bug:10622962

Change-Id: I55ac18ad56b53dc9e6e6ea14cd3ec4bdafa98ac3
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
5af5fc50c2f43fc0e0813e02cb6a950901a9c0b8 13-Sep-2013 Chris Craik <ccraik@google.com> Fix merged operation clipping

bug:10745870

Missing 'const' meant MergingDrawBatch would never clip anything.

Change-Id: Ia6367eff94cf5f437efafbc3ba7f0da102ffd956
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
c1c5f0870282b56dafe5a4d756e4b9e6884655a7 12-Sep-2013 Chris Craik <ccraik@google.com> Move DeferredDisplayState out of ops

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
0e87f00f8cb79635aa70b9a2dfa02bf19dc7473d 20-Jun-2013 Chris Craik <ccraik@google.com> Initialize MergingDrawBatch clip with viewport bounds

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
36d38cb904556025b76c6d98f9fe2ccfa1c8a304 17-Jun-2013 Chris Craik <ccraik@google.com> Merge "Better handle op size edge cases"
d72b73cea49f29c41661e55eb6bfdbc04f09d809 17-Jun-2013 Chris Craik <ccraik@google.com> Better handle op size edge cases

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
a02c4ed885d97e516f844ddb0a96083f1b45b4cb 14-Jun-2013 Chris Craik <ccraik@google.com> Fix clip merging behavior

Previously, a new op with a clipped side could be added to a
MergingDrawBatch without considering the batch's current bounds.

Change-Id: I1b873ecf821bad7cda6630c3f311edd90ac5cc8c
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
f70119cd776f871a82c94be8522dce02e04c73a8 13-Jun-2013 Chris Craik <ccraik@google.com> Reset batching state when overlap batch deletion occurs

Change-Id: Ifdbee9baaa734e27d15d2b54aa3b3abfffbce1e9
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
28ce94a4ffc7576f40776d212f1ada79fafaa061 31-May-2013 Chris Craik <ccraik@google.com> Overdraw avoidance and merging of clipped ops

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
7f77736599c39cdd5540168fc652cf6846799a33 22-May-2013 Romain Guy <romainguy@google.com> Merge "Merge scaled bitmaps with translated bitmaps"
2db5e993b626794eb07a0ff354269f9a77da81b3 22-May-2013 Romain Guy <romainguy@google.com> Merge scaled bitmaps with translated bitmaps

Change-Id: I03089f48f97b69fcb4a0171984d3ff548d41c4a8
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
41541825bc90dac740e424cdd41a8c997e15cdb7 04-May-2013 Chris Craik <ccraik@google.com> Use individual glyph positions to determine text bounds.

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
d4b43b3cf3ee109a5251228dcc1d9bc3c25ff150 09-May-2013 Chris Craik <ccraik@google.com> Fix off by one error in log tracking

bug:8875715

Additionally moves op logging before the op is executed, to print
correctly, in pre-order traversal

Change-Id: I4e9566261f8363c73739d183e6d82b854f72ffad
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
527a3aace1dd72432c2e0472a570e030ad04bf16 04-Mar-2013 Chris Craik <ccraik@google.com> Draw Operation merging

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
cf51a4199835e9604aa4c8b3854306f8fbabbf33 09-Apr-2013 Romain Guy <romainguy@google.com> Introduce PixelBuffer API to enable PBOs

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
1ed30c907ffbb71d1bc448ee57c66b0d16f600ef 03-Apr-2013 Chris Craik <ccraik@google.com> Correct save/restore match up

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
7273daace9303f4662444111c40bb83d3ead4a92 28-Mar-2013 Chris Craik <ccraik@google.com> Fix issues related to saveLayer/restore deferral

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
a4e16c58c9e3c983251e0475125a2a6f5bec2dbf 22-Mar-2013 Chris Craik <ccraik@google.com> Restore final canvas state after deferred flush

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
d90144db52c7297879b950cbbc85137ed123ab5b 19-Mar-2013 Chris Craik <ccraik@google.com> Update snapshot upon saveLayer deferral

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
4494599e5a4931426d5649e1d1c4f9db83824ae8 20-Mar-2013 Chris Craik <ccraik@google.com> Merge "Use snapshot alpha for layers" into jb-mr2-dev
c46d07a29e94807e768f8b162ce9f77a88ba6f46 16-Mar-2013 Romain Guy <romainguy@google.com> Merge all shapes/paths caches to PathCache

This change will greatly simplify the multi-threading of all
shape types.

This change also uses PathTessellator to render convex paths.

Change-Id: I4e65bc95c9d24ecae2183b72204de5c2dfb6ada4
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
d0afeac6dfc0856eeb72e6176ad6335e81871d24 16-Mar-2013 Chris Craik <ccraik@google.com> Reset draw modifiers after flushing

bug:8401910

This avoids leaving the renderer in a state with stale pointers (to,
e.g., shaders or color filters)

Change-Id: Idf8b63657041352e70e34e91ea416fe4385d4bc2
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
a08f95cfeca7217f9c533b03663bf0dceedd259a 16-Mar-2013 Chris Craik <ccraik@google.com> Use snapshot alpha for layers

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
ff78583d8a73ca35ce65b5d2592570ff6fb9901b 08-Mar-2013 Chris Craik <ccraik@google.com> Fully deferred displaylist replay

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
0f6675332c04c74909425d1d328f02b32c0ff40e 01-Mar-2013 Romain Guy <romainguy@google.com> Precache glyphs at final raster size

The deferred display lists model now allows us to precache glyphs
at their exact size on screen.

This change also removes debug markers when the renderer defers
and reorders display lists. It also adds a flush event marker.

Change-Id: I66ec5216dc12b93ecfdad52a7146b1cfb31fbeb4
/frameworks/base/libs/hwui/DeferredDisplayList.cpp
c3566d06421c8acc0aafb18f7e307e5725ce87e1 05-Feb-2013 Chris Craik <ccraik@google.com> DisplayList draw operation reordering

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
/frameworks/base/libs/hwui/DeferredDisplayList.cpp