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
diff --git a/libs/hwui/Stencil.h b/libs/hwui/Stencil.h
index 2f8a66a..047f7ee 100644
--- a/libs/hwui/Stencil.h
+++ b/libs/hwui/Stencil.h
@@ -21,6 +21,8 @@
     #define LOG_TAG "OpenGLRenderer"
 #endif
 
+#include <GLES2/gl2.h>
+
 #include <cutils/compiler.h>
 
 namespace android {
@@ -41,6 +43,11 @@
     ANDROID_API static uint32_t getStencilSize();
 
     /**
+     * Returns the smallest stencil format accepted by render buffers.
+     */
+    static GLenum getSmallestStencilFormat();
+
+    /**
      * Clears the stencil buffer.
      */
     void clear();