Further reduce the number of GL commands sent to the driver
Change-Id: Id922b2a166ea4573b767c27d3195e11c70320b23
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index 6143593..edf3a47 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -70,6 +70,12 @@
static const GLsizei gVertexAALengthOffset = 3 * sizeof(float);
static const GLsizei gMeshCount = 4;
+static const GLenum gTextureUnits[] = {
+ GL_TEXTURE0,
+ GL_TEXTURE1,
+ GL_TEXTURE2
+};
+
///////////////////////////////////////////////////////////////////////////////
// Debug
///////////////////////////////////////////////////////////////////////////////
@@ -176,6 +182,12 @@
void disbaleTexCoordsVertexArray();
/**
+ * Activate the specified texture unit. The texture unit must
+ * be specified using an integer number (0 for GL_TEXTURE0 etc.)
+ */
+ void activeTexture(GLuint textureUnit);
+
+ /**
* Returns the mesh used to draw regions. Calling this method will
* bind a VBO of type GL_ELEMENT_ARRAY_BUFFER that contains the
* indices for the region mesh.
@@ -226,6 +238,8 @@
bool mTexCoordsArrayEnabled;
+ GLuint mTextureUnit;
+
// Used to render layers
TextureVertex* mRegionMesh;
GLuint mRegionMeshIndices;