diff options
| author | 2014-06-16 23:47:34 +0000 | |
|---|---|---|
| committer | 2014-06-16 23:47:34 +0000 | |
| commit | 88b1c9ad87ca6d6faaf824bff4ee9d3c799362e5 (patch) | |
| tree | e4364cc9f9c67df550cb1eeb7aa1994a577fc86c /libs/hwui/Caches.cpp | |
| parent | 678886fde5cd779de79f8e38479aa6de82f8e755 (diff) | |
| parent | e709d53ff31c74a6abf2a27350966d18d8dad4f7 (diff) | |
am e709d53f: am 0d28bb47: Merge "Fix the texture ID reuse issue in HWUI."
* commit 'e709d53ff31c74a6abf2a27350966d18d8dad4f7':
Fix the texture ID reuse issue in HWUI.
Diffstat (limited to 'libs/hwui/Caches.cpp')
| -rw-r--r-- | libs/hwui/Caches.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp index f8d3589168b6..b0f4c2c7189d 100644 --- a/libs/hwui/Caches.cpp +++ b/libs/hwui/Caches.cpp @@ -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); } @@ -566,6 +563,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 /////////////////////////////////////////////////////////////////////////////// |