summaryrefslogtreecommitdiffstats
path: root/libs/hwui/DisplayListRenderer.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-11-09 14:35:20 -0800
committerRomain Guy <romainguy@google.com>2010-11-09 14:37:42 -0800
commit9e10841c27d973b930e1b49a099c69d866659505 (patch)
treeaaf593ba3581cf97a6b031a7b310e696f5cbb51a /libs/hwui/DisplayListRenderer.cpp
parent820b9e0d3b6f94fe0b524aebf756ce25df273e6a (diff)
downloadframeworks_base-9e10841c27d973b930e1b49a099c69d866659505.zip
frameworks_base-9e10841c27d973b930e1b49a099c69d866659505.tar.gz
frameworks_base-9e10841c27d973b930e1b49a099c69d866659505.tar.bz2
Correctly remove unused paths from the cache.
Change-Id: I41d9334dcd9871634037344ab49bf69383498161
Diffstat (limited to 'libs/hwui/DisplayListRenderer.cpp')
-rw-r--r--libs/hwui/DisplayListRenderer.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index 770e596..d08df44 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -127,7 +127,9 @@ DisplayList::DisplayList(const DisplayListRenderer& recorder) {
}
mPathHeap = recorder.mPathHeap;
- mPathHeap->safeRef();
+ if (mPathHeap) {
+ mPathHeap->safeRef();
+ }
}
DisplayList::~DisplayList() {
@@ -155,7 +157,12 @@ DisplayList::~DisplayList() {
}
mMatrices.clear();
- mPathHeap->safeUnref();
+ if (mPathHeap) {
+ for (int i = 0; i < mPathHeap->count(); i++) {
+ caches.pathCache.remove(&(*mPathHeap)[i]);
+ }
+ mPathHeap->safeUnref();
+ }
}
void DisplayList::init() {