summaryrefslogtreecommitdiff
path: root/libs/hwui/Caches.cpp
diff options
context:
space:
mode:
author Chris Craik <ccraik@android.com> 2014-06-17 01:31:21 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2014-06-17 01:31:21 +0000
commit0732ba5756296f1ae3da48a39e4d498aba366386 (patch)
treec0b4ab3461d2ac90ebfa51a0b1519880bc23f06f /libs/hwui/Caches.cpp
parent11a8d4f8b99549262bcc9b64efe8ca21801c8f91 (diff)
parent88b1c9ad87ca6d6faaf824bff4ee9d3c799362e5 (diff)
am 88b1c9ad: am e709d53f: am 0d28bb47: Merge "Fix the texture ID reuse issue in HWUI."
* commit '88b1c9ad87ca6d6faaf824bff4ee9d3c799362e5': Fix the texture ID reuse issue in HWUI.
Diffstat (limited to 'libs/hwui/Caches.cpp')
-rw-r--r--libs/hwui/Caches.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 6fd9999d132d..402f28bd3c5a 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -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
///////////////////////////////////////////////////////////////////////////////