Loading libs/hwui/Caches.cpp +14 −5 Original line number Diff line number Diff line Loading @@ -554,11 +554,8 @@ void Caches::deleteTexture(GLuint texture) { // call, any texture operation will be performed on the default // texture (name=0) for (int i = 0; i < REQUIRED_TEXTURE_UNITS_COUNT; i++) { if (mBoundTextures[i] == texture) { mBoundTextures[i] = 0; } } unbindTexture(texture); glDeleteTextures(1, &texture); } Loading @@ -566,6 +563,18 @@ void Caches::resetBoundTextures() { memset(mBoundTextures, 0, REQUIRED_TEXTURE_UNITS_COUNT * sizeof(GLuint)); } uint32_t Caches::getBoundTexture() { return mBoundTextures[mTextureUnit]; } void Caches::unbindTexture(GLuint texture) { for (int i = 0; i < REQUIRED_TEXTURE_UNITS_COUNT; i++) { if (mBoundTextures[i] == texture) { mBoundTextures[i] = 0; } } } /////////////////////////////////////////////////////////////////////////////// // Scissor /////////////////////////////////////////////////////////////////////////////// Loading libs/hwui/Caches.h +10 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,16 @@ public: */ void resetBoundTextures(); /** * Get the mBoundTextures[mTextureUnit]. */ uint32_t getBoundTexture(); /** * Clear the cache of bound textures. */ void unbindTexture(GLuint texture); /** * Sets the scissor for the current surface. */ Loading libs/hwui/Layer.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,9 @@ void Layer::deleteTexture() { } void Layer::clearTexture() { if (texture.id == caches.getBoundTexture()) { caches.unbindTexture(texture.id); } texture.id = 0; } Loading Loading
libs/hwui/Caches.cpp +14 −5 Original line number Diff line number Diff line Loading @@ -554,11 +554,8 @@ void Caches::deleteTexture(GLuint texture) { // call, any texture operation will be performed on the default // texture (name=0) for (int i = 0; i < REQUIRED_TEXTURE_UNITS_COUNT; i++) { if (mBoundTextures[i] == texture) { mBoundTextures[i] = 0; } } unbindTexture(texture); glDeleteTextures(1, &texture); } Loading @@ -566,6 +563,18 @@ void Caches::resetBoundTextures() { memset(mBoundTextures, 0, REQUIRED_TEXTURE_UNITS_COUNT * sizeof(GLuint)); } uint32_t Caches::getBoundTexture() { return mBoundTextures[mTextureUnit]; } void Caches::unbindTexture(GLuint texture) { for (int i = 0; i < REQUIRED_TEXTURE_UNITS_COUNT; i++) { if (mBoundTextures[i] == texture) { mBoundTextures[i] = 0; } } } /////////////////////////////////////////////////////////////////////////////// // Scissor /////////////////////////////////////////////////////////////////////////////// Loading
libs/hwui/Caches.h +10 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,16 @@ public: */ void resetBoundTextures(); /** * Get the mBoundTextures[mTextureUnit]. */ uint32_t getBoundTexture(); /** * Clear the cache of bound textures. */ void unbindTexture(GLuint texture); /** * Sets the scissor for the current surface. */ Loading
libs/hwui/Layer.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,9 @@ void Layer::deleteTexture() { } void Layer::clearTexture() { if (texture.id == caches.getBoundTexture()) { caches.unbindTexture(texture.id); } texture.id = 0; } Loading