summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2013-07-22 16:16:06 -0700
committerChris Craik <ccraik@google.com>2013-07-22 16:21:55 -0700
commit9ab2d1847552aa4169b4325aae1b1368d6947a9f (patch)
tree52955e896e6f021961bbfc9dd52003c918fdbb50 /libs/hwui
parent7bfddb5434736a26fa9b32d7cd1741067169ae74 (diff)
downloadframeworks_base-9ab2d1847552aa4169b4325aae1b1368d6947a9f.zip
frameworks_base-9ab2d1847552aa4169b4325aae1b1368d6947a9f.tar.gz
frameworks_base-9ab2d1847552aa4169b4325aae1b1368d6947a9f.tar.bz2
Ensure glActiveTexture is cleaned up correctly on functor resume
Change-Id: I103d7d63b17289d599c2c08dcc442cfba9b8e51d
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/Caches.cpp4
-rw-r--r--libs/hwui/Caches.h5
-rw-r--r--libs/hwui/OpenGLRenderer.cpp1
3 files changed, 10 insertions, 0 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 6de8c8c..6ac637e 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -495,6 +495,10 @@ void Caches::activeTexture(GLuint textureUnit) {
}
}
+void Caches::resetActiveTexture() {
+ mTextureUnit = -1;
+}
+
void Caches::bindTexture(GLuint texture) {
if (mBoundTextures[mTextureUnit] != texture) {
glBindTexture(GL_TEXTURE_2D, texture);
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index b7a97ad..f8b1e17 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -226,6 +226,11 @@ public:
void activeTexture(GLuint textureUnit);
/**
+ * Invalidate the cached value of the active texture unit.
+ */
+ void resetActiveTexture();
+
+ /**
* Binds the specified texture as a GL_TEXTURE_2D texture.
* All texture bindings must be performed with this method or
* bindTexture(GLenum, GLuint).
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 3e84273..dcf4ecf 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -351,6 +351,7 @@ void OpenGLRenderer::interrupt() {
mCaches.currentProgram = NULL;
}
}
+ mCaches.resetActiveTexture();
mCaches.unbindMeshBuffer();
mCaches.unbindIndicesBuffer();
mCaches.resetVertexPointers();