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
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
Previously, a new op with a clipped side could be added to a
MergingDrawBatch without considering the batch's current bounds.
Change-Id: I1b873ecf821bad7cda6630c3f311edd90ac5cc8c
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
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
bug:8875715
Additionally moves op logging before the op is executed, to print
correctly, in pre-order traversal
Change-Id: I4e9566261f8363c73739d183e6d82b854f72ffad
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
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
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
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
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
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
This change will greatly simplify the multi-threading of all
shape types.
This change also uses PathTessellator to render convex paths.
Change-Id: I4e65bc95c9d24ecae2183b72204de5c2dfb6ada4
bug:8401910
This avoids leaving the renderer in a state with stale pointers (to,
e.g., shaders or color filters)
Change-Id: Idf8b63657041352e70e34e91ea416fe4385d4bc2
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
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
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
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