Clipping performance improvements
Create a ClipArea class to handle tracking clip regions. This class can
select the most efficient implementation depending on the types of
clipping presented.
ClipArea re-used the rectangle and region-based clipping
implementations as well as adding a "list of rotated rectangles"
approach that is more efficient for rotated views with children.
Change-Id: I2133761a2462ebc0852b394220e265974b3086f0
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 9d9b3d2..f613183 100755
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -223,9 +223,6 @@
return mCaches;
}
- // simple rect clip
- bool isCurrentClipSimple() { return mState.isCurrentClipSimple(); }
-
int getViewportWidth() { return mState.getViewportWidth(); }
int getViewportHeight() { return mState.getViewportHeight(); }
@@ -433,6 +430,13 @@
*/
void attachStencilBufferToLayer(Layer* layer);
+ /**
+ * Draw a rectangle list. Currently only used for the the stencil buffer so that the stencil
+ * will have a value of 'n' in every unclipped pixel, where 'n' is the number of rectangles
+ * in the list.
+ */
+ void drawRectangleList(const RectangleList& rectangleList);
+
bool quickRejectSetupScissor(float left, float top, float right, float bottom,
const SkPaint* paint = nullptr);
bool quickRejectSetupScissor(const Rect& bounds, const SkPaint* paint = nullptr) {