diff options
| -rw-r--r-- | libs/hwui/Caches.cpp | 8 | ||||
| -rw-r--r-- | libs/hwui/Caches.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp index f8d3589168b6..64853bd73a16 100644 --- a/libs/hwui/Caches.cpp +++ b/libs/hwui/Caches.cpp @@ -534,9 +534,13 @@ void Caches::bindTexture(GLuint texture) { } void Caches::bindTexture(GLenum target, GLuint texture) { - if (mBoundTextures[mTextureUnit] != texture) { + if (target == GL_TEXTURE_2D) { + bindTexture(texture); + } else { + // GLConsumer directly calls glBindTexture() with + // target=GL_TEXTURE_EXTERNAL_OES, don't cache this target + // since the cached state could be stale glBindTexture(target, texture); - mBoundTextures[mTextureUnit] = texture; } } diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h index 282aee901006..bddb021882a1 100644 --- a/libs/hwui/Caches.h +++ b/libs/hwui/Caches.h @@ -410,6 +410,7 @@ private: uint32_t mFunctorsCount; + // Caches texture bindings for the GL_TEXTURE_2D target GLuint mBoundTextures[REQUIRED_TEXTURE_UNITS_COUNT]; OverdrawColorSet mOverdrawDebugColorSet; |