7 Commits

Author SHA1 Message Date
Romain Guy
3bbacf27c0 Add a RenderBuffer object to store stencil buffers.
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
2013-02-07 12:11:22 -08:00
Romain Guy
8ce00301a0 Implement clipRect with a transform, clipRegion & clipPath
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
2013-01-17 15:39:31 -08:00
Romain Guy
7c450aaa3c Add support for a new developer setting: overdraw debugging
Change-Id: I350ba4486577c3289f82c20938f7a35138778727
2012-09-21 19:15:00 -07:00
Romain Guy
f7e52d92b4 Finish this bit before I forget.
This code is not enabled in current builds.

Change-Id: I488ec9e94889efbf2c8f3312abfed4298a76b7f1
2012-09-21 15:06:52 -07:00
Romain Guy
0baaac5e9a Revert "Revert "Add more support for transformed clip rects and paths""
This reverts commit a8557d2169e14997637f57bc897640c8882d4a46.

Change-Id: I36d4883d548fc47ba6c0b4a42012107d0d2f85a6
2012-08-31 20:31:32 -07:00
Mathias Agopian
a8557d2169 Revert "Add more support for transformed clip rects and paths"
this introduced a dead lock in GradientCache's ctor.

This reverts commit dfe082f63e94cde9aee271c94d13de5e7217e036.

Bug: 7096001
Change-Id: I57b8bbab11fb7cb502fa58e3bbf5d19864db874f
2012-08-31 20:04:18 -07:00
Romain Guy
dfe082f63e Add more support for transformed clip rects and paths
Change-Id: I41791b1e1bffef77d503dc9e52428395d2309688
2012-08-31 17:17:40 -07:00