Improve rendering speed by disabling scissor tests
This change improves execution of display lists, particularly on
tiled renderers. The goal is to disable the scissor test as
often as possible. Drawing commands are rarely clipped by View
bounds so most of them can be drawn without doing a scissor test.
The speed improvements scale with the number of views and drawing
commands.
Change-Id: Ibd9b5e051a3e4300562463805acc4fd744ba6266
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index 58361c9..f83e291 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -204,6 +204,10 @@
*/
void resetScissor();
+ void enableScissor();
+ void disableScissor();
+ void setScissorEnabled(bool enabled);
+
/**
* Returns the mesh used to draw regions. Calling this method will
* bind a VBO of type GL_ELEMENT_ARRAY_BUFFER that contains the
@@ -221,6 +225,7 @@
GLenum lastSrcMode;
GLenum lastDstMode;
Program* currentProgram;
+ bool scissorEnabled;
// VBO to draw with
GLuint meshBuffer;