Reduce the number of GL commands generated by the UI

This optimization along with the previous one lets us render an
application like Gmail using only 30% of the number of GL commands
previously required

Change-Id: Ifee63edaf495e04490b5abd5433bb9a07bc327a8
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index 7ca198a..6143593 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -150,6 +150,9 @@
      */
     bool unbindMeshBuffer();
 
+    bool bindIndicesBuffer(const GLuint buffer);
+    bool unbindIndicesBuffer();
+
     /**
      * Binds an attrib to the specified float vertex pointer.
      * Assumes a stride of gMeshStride and a size of 2.
@@ -169,6 +172,9 @@
     void resetVertexPointers();
     void resetTexCoordsVertexPointer();
 
+    void enableTexCoordsVertexArray();
+    void disbaleTexCoordsVertexArray();
+
     /**
      * Returns the mesh used to draw regions. Calling this method will
      * bind a VBO of type GL_ELEMENT_ARRAY_BUFFER that contains the
@@ -214,9 +220,12 @@
 
 private:
     GLuint mCurrentBuffer;
+    GLuint mCurrentIndicesBuffer;
     void* mCurrentPositionPointer;
     void* mCurrentTexCoordsPointer;
 
+    bool mTexCoordsArrayEnabled;
+
     // Used to render layers
     TextureVertex* mRegionMesh;
     GLuint mRegionMeshIndices;