summaryrefslogtreecommitdiff
path: root/libs/hwui/TextureCache.cpp
diff options
context:
space:
mode:
author Sergei Vasilinetc <sergeyv@google.com> 2017-02-01 22:47:59 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-02-01 22:48:06 +0000
commit2cf7b1f1425819c31a7ccd1c09f5bc9f3ab5c265 (patch)
treea2001aeb3c8ffae07055471b328d034d08e9be15 /libs/hwui/TextureCache.cpp
parent0fcdf4399e86ea3fb905b1298915afec46fb3be6 (diff)
parent83809fec686b47da73ee0aaa80d226de7e33aab9 (diff)
Merge "Properly clear textures for Hardware Bitmaps"
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
-rw-r--r--libs/hwui/TextureCache.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index 1aeb8d684a29..63a6a2c8c89c 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -46,7 +46,7 @@ TextureCache::TextureCache()
}
TextureCache::~TextureCache() {
- mCache.clear();
+ this->clear();
}
///////////////////////////////////////////////////////////////////////////////
@@ -214,6 +214,10 @@ void TextureCache::clearGarbage() {
void TextureCache::clear() {
mCache.clear();
+ for(auto& iter: mHardwareTextures) {
+ iter.second->deleteTexture();
+ }
+ mHardwareTextures.clear();
TEXTURE_LOGD("TextureCache:clear(), mSize = %d", mSize);
}