* commit '88b1c9ad87ca6d6faaf824bff4ee9d3c799362e5': Fix the texture ID reuse issue in HWUI.
This commit is contained in:
@@ -565,11 +565,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);
|
||||
}
|
||||
|
||||
@@ -577,6 +574,14 @@ void Caches::resetBoundTextures() {
|
||||
memset(mBoundTextures, 0, REQUIRED_TEXTURE_UNITS_COUNT * sizeof(GLuint));
|
||||
}
|
||||
|
||||
void Caches::unbindTexture(GLuint texture) {
|
||||
for (int i = 0; i < REQUIRED_TEXTURE_UNITS_COUNT; i++) {
|
||||
if (mBoundTextures[i] == texture) {
|
||||
mBoundTextures[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Scissor
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -260,6 +260,11 @@ public:
|
||||
*/
|
||||
void resetBoundTextures();
|
||||
|
||||
/**
|
||||
* Clear the cache of bound textures.
|
||||
*/
|
||||
void unbindTexture(GLuint texture);
|
||||
|
||||
/**
|
||||
* Sets the scissor for the current surface.
|
||||
*/
|
||||
|
||||
@@ -185,6 +185,7 @@ void Layer::deleteTexture() {
|
||||
}
|
||||
|
||||
void Layer::clearTexture() {
|
||||
caches.unbindTexture(texture.id);
|
||||
texture.id = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user