diff options
author | Chris Craik <ccraik@google.com> | 2013-07-22 23:31:18 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-07-22 23:31:20 +0000 |
commit | 98427708a81eefcc24ae29e2f22e55f1ae44c927 (patch) | |
tree | b541f690c964d8bce9562a93203dd7aeb5ad909b /libs/hwui | |
parent | fd23eca5ba30a1624233c9597f8c4b9db790994b (diff) | |
parent | 9ab2d1847552aa4169b4325aae1b1368d6947a9f (diff) | |
download | frameworks_base-98427708a81eefcc24ae29e2f22e55f1ae44c927.zip frameworks_base-98427708a81eefcc24ae29e2f22e55f1ae44c927.tar.gz frameworks_base-98427708a81eefcc24ae29e2f22e55f1ae44c927.tar.bz2 |
Merge "Ensure glActiveTexture is cleaned up correctly on functor resume"
Diffstat (limited to 'libs/hwui')
-rw-r--r-- | libs/hwui/Caches.cpp | 4 | ||||
-rw-r--r-- | libs/hwui/Caches.h | 5 | ||||
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 1 |
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 06315ba..bc00ce8 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -360,6 +360,7 @@ void OpenGLRenderer::interrupt() { mCaches.currentProgram = NULL; } } + mCaches.resetActiveTexture(); mCaches.unbindMeshBuffer(); mCaches.unbindIndicesBuffer(); mCaches.resetVertexPointers(); |