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
The last frame of an animation stays stuck on the screen for a couple of frames.
Specifically, the "Quick Contact" animation that animates the picture
closed (fades/scales it away) animates all the way to the end... then hangs there
briefly before being taken down.
The problem is a rendering bug where we correctly detect that a DisplayList
has nothing to draw (since the last frame is completely transparent, alpha==0),
but incorrectly ignore the fact that we cleared the transparent-background
window prior to not-drawing that DisplayList. When we detect that there's
nothing to draw, we don't bother swapping buffers. So even though we drew
the right thing (clearing the buffer), we didn't actually post the buffer to the
screen.
This change factors in both the clear and the draw to decide when to swap buffers.
Issue #8564865 Quick contact close animation jank redux
Change-Id: Ib922cff88a94f025b62f7461c1a29e96fe454838
This is a more elegant way to sample from a float alpha texture.
Instead of sampling from the red channel in the fragment shader
we can set the alpha channel swizzle to redirect it to the
red channel. This lets us sample from the alpha channel in the
fragment shader and get the correct value.
Change-Id: I95bbf7a82964e1bf42c0fee1b782b6bdbbcef618
Float textures offer better precision for dithering.
In addition this change removes two uniforms from gradient shaders.
These uniforms were used to dither gradients but their value is
a build time constant. Instead we hardcode the value directly in
the shader source at compile time.
Change-Id: I05e9fd3eef93771843bbd91b453274452dfaefee
bug:8540150
Layers now require traversal in update order, as it will be child
first, then parent for layer-in-layer
Fixes issue with deferred layer playback not flushing in order, and
thus child not painting before parent
Also fixes DisplayList to only be cleared after flush in deferred list
Change-Id: I2f284d00079cdb20798aeef6a1c94e823940db40
This change uses a new OpenGL ES 3.0 feature to upload less data when
the font cache needs to be update. This can result in significant
performance improvements on device with large textures or with locales
that use a lot of glyphs (CJK for instance.)
This change also fixes various unpack alignment issues. The unpack
alignment, as well as the unpack row length, is not texture specific
but a global state that affect all glTex/SubImage2D calls. Some of
them were missing the appropriate glPixelStorei() call. This could
result in corrupted textures.
Change-Id: Iefb429d4d0d0b4e0faeadf27daafee6d30a21d85
SystemServer is currently a monolithic class that brings up key system
services. This change is the first phase of refactoring it to be more
configurable. Specifically, it adds a set of on/off switches used to control
startup of individual services. Future plans include finer grained controls
and a more explicit and consistent startup sequence for these services.
Change-Id: I7299f5ce7d7b74a34eb56dffb788366fbc058532
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:8501661
Makes the performance issues and interaction with layer type/paint
more clear.
Additionally, corrects change from 47ab7d6612e2b5b8b66fb261dafef7c91264e173
to still allow displayList alpha to override layer paint
Change-Id: Ic94d75865700820489370461cd8ac9f9077a8d90
Bug #8489505
A layer should be updated even with an empty deferred display list. It is
possible for a layer to request an update just to execute a clear which
will be handled by LayerRenderer::prepareDirty().
Change-Id: Iffb98bd71d6caa8d4a701df98197676f9423c0c2
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 #8437401
A misplaced ref count decrement was causing a crash when attempting to
resize a layer to dimensions larger than the max texture size supported
by the GPU.
This change fixes the crash and clarifies the warnings to make it more
obvious what's happening.
Change-Id: I632dc1b90aaa2605969e10523491a81c4922d3dc
bug:8471552
Additionally, add ignore check for draw functor
In deferred mode, if we don't set ignore, a 0 alpha displayList won't
be quickRejected, and not only would its contents be needlessly
deferred, but upon playback any functors would be drawn, ignoring the
state of the snapshot.
Change-Id: Ib1edb3252080f674254086edee6f965f0efcce78
Bug #8378964
This change defers drawing into layers until after the renderer for FBO0
is ready to draw. At that point, all the precaching is done which means
all glyphs can be uploaded at once in the font caches.
Change-Id: Ie1f7a7ff30f76f06fb3dbc72c7d05e66207d1ecb
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
Snapshots frequently have their clip overwritten due to applying
deferred state - now, store tiling clip information in a separate
rect, outside of the snapshot so it isn't overwritten.
Change-Id: I21ca4c45dcd802eae99e8de86f11525196777ccb