summaryrefslogtreecommitdiff
path: root/libs/hwui/TextureCache.cpp
diff options
context:
space:
mode:
author sergeyv <sergeyv@google.com> 2017-02-01 10:27:33 -0800
committer sergeyv <sergeyv@google.com> 2017-02-01 12:44:28 -0800
commit83809fec686b47da73ee0aaa80d226de7e33aab9 (patch)
tree9aae539b477c1b52f801c6276e6285058bc82cbb /libs/hwui/TextureCache.cpp
parenta99952c18db3e40ea50eb36bf8978ac29cf1fbb3 (diff)
Properly clear textures for Hardware Bitmaps
Test: manual (Description in the bug) bug:34858530 Change-Id: I13eb89077c43ca28436509a7af5b7c11374446c4
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);
}