Bug #8177690
Clear the layers before we setup the stencil to avoid dereferencing
the recently deleted rects.
Change-Id: I5dce5f965672f276f9490636d85b6018d3ab9422
A layer will, by definition, clip its content already. The extra
clip added by the UI toolkit/renderer is wasteful and in some
situations very expensive. If a layered view is rotated, the clip
will be transformed into a non-rectangular region, thus forcing
the renderer to rely on the stencil buffer. The whole point of
using layers is to draw efficiently so let's avoid this case.
Change-Id: I813465f6468cc386b84a4d058c11a258fef8507a
Bug #7146141
This change is needed to add a render buffer cache to avoid
creating and destroying stencil buffers on every frame.
This change also allows the renderer to use a 1 bit or 4 bit
stencil buffer whenever possible.
Finally this change fixes a bug introduced by a previous CL
which causes the stencil buffer to not be updated in certain
conditions. The fix relies on a new optional parameter in
drawColorRects() that can be used to avoid performing a
quickReject on rectangles generated by the clip region.
Change-Id: I2f55a8e807009887b276a83cde9f53fd5c01199f
bug:7117155
bug:8114304
Currently used for lines (with and without AA) and arcs with useCenter=false
Also removes 0.375, 0.375 offset for AA lines
Change-Id: Ic8ace418739344db1e2814edf65253fe7448b0b0
# Via Android (Google) Code Review (1) and Romain Guy (1)
* commit 'b377853123ff53974bb06ffc30e09db41a767c3a':
Set the scissor from OpenGLRenderer::drawColorRects Bug #8131254
Bug #8131254
This method is used as an optimization for paths containing only
non-overlapping rectangles. The implementation was correctly
rejecting rectangles invidually but not the bounds of the array
of rectangles. If quickReject() is not called, setupDraw() won't
be able to properly set the scissor.
Change-Id: I50aa11a4bd8b525b267d36a3039fe7a6fba50518
# Via Android (Google) Code Review (1) and Chris Craik (1)
* commit 'e51ccb1543ef5b6427e5f270ae38be75e18daccd':
Simplify display list logging, removing pointers
# Via Android (Google) Code Review (1) and Romain Guy (1)
* commit 'c580168011334db756f5e68aa005d20bace69171':
Tag HardwareRenderers with a name to help debugging
# Via Android (Google) Code Review (1) and Romain Guy (1)
* commit '65f4effcab1f4bb6e2e96a2b8eb2c774601b87db':
Discard the correct buffer when the bound FBO is not 0
Rename Caches::startTiling parameter from opaque to discard to
make it clearer what its role is. Tweak calls to startTiling
to preserve the buffer when needed and discard it when possible.
Change-Id: If7f8ff19003f79f36885a0a7207cc61901f637d2
glDiscardFramebufferEXT uses different constants depending on whether
the default FBO is bound or not. The code was choosing the proper value
for the color buffer but not for the stencil buffer.
Change-Id: I55cfcbdf663582119cb1a6289317016440d9e361
Bug #7146141
The GL_QCOM_tiled_rendering extension requires careful use of
start/endTiling when attaching a renderbuffer dynamically.
Change-Id: I20036683ed3909ffaf40cc3d57a25257e35b6fa2
bug:8037003
Changes the DisplayList from using stream read/write commands to use an array of
objects manually allocated on a linear buffer.
Depends on frameworks/native change https://googleplex-android-review.googlesource.com/#/c/257695/ which adds LinearAllocator
Also changes drawRects to use float count instead of rect count, to be more like drawLines/drawPoints
Change-Id: Ia2e4a11acd8f0a757042a05cbc9e7563cb73ee47
Bug #7146141
This change moves the resizeLayer() from LayerCache (where it should
never have been anyway) to Layer. This makes a little more sense.
Change-Id: I8b2f9c19c558e738405a58b9e71ec5799fc6be88
Bug #7146141
When non-rectangular clipping occurs in a layer the render buffer
used as the stencil buffer is not cached. If this happens on a
View's hardware layer the render buffer will live for as long
as the layer is bound to the view. When a stencil buffer is
required because of a call to Canvas.saveLayer() it will be allocated
on every frame. A future change will address this problem.
If "show GPU overdraw" is enabled, non-rectangular clips are not
supported anymore and we fall back to rectangular clips instead.
This is a limitation imposed by OpenGL ES that cannot be worked
around at this time.
This change also improves the Matrix4 implementation to easily
detect when a rect remains a rect after transform.
Change-Id: I0e69fb901792d38bc0c4ca1bf9fdb02d7db415b9
Region clipping, using Canvas.clipPath or Canvas.clipRegion, requires
a stencil buffer to be always present. In addition, extra wiring is
required in JNI and display lists.
This change only adds the necessary JNI/C++ APIs and some extra
plumbing to start the real work on properly supporting region
clipping.
A new debug define called DEBUG_CLIP_REGIONS can be used to draw
the current clip region. It is off by default, as is region
clipping.
The default implementation of clipPath() and clipRegion(), now
in native, mimics the previous Dalvik implementation to prevent
regressions.
Change-Id: I7903e7cfd7412b9b9b622566d4dbfce7bdcec00c
Bug #7970966
The bug described in #7970966 should normally never happen but just in
case, change the detection code to be more robust.
Change-Id: I7040a6087590e34abe8803cb8f83f051d77f3944
Fonts are now described by a transform matrix. This lead to switching
from a vector to a hashmap. This change therefore adds new comparators
and hash computations to Font.
Change-Id: I2daffa7d6287c18554c606b8bfa06640d28b4530
When profiling is enabled with debug.hwui.profile set to true,
setting debug.hwui.profile_visualizer to true will display the
profiling data directly on screen.
Change-Id: I3d5fe3f0347090815087b1cbfce66b8e76d9347b