summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-02-24 19:52:37 -0800
committerRomain Guy <romainguy@google.com>2011-02-24 19:52:37 -0800
commit7b8b75892400745f39bb8d5b5d539091bcfb1e1e (patch)
tree778b45db31f62556e64d57224d544f91addb58ed /libs
parent7f4a537af5ec1c935b9d139b722da05e9fe8130f (diff)
downloadframeworks_base-7b8b75892400745f39bb8d5b5d539091bcfb1e1e.zip
frameworks_base-7b8b75892400745f39bb8d5b5d539091bcfb1e1e.tar.gz
frameworks_base-7b8b75892400745f39bb8d5b5d539091bcfb1e1e.tar.bz2
Remove the right entries from the cache when a GC happens.
Change-Id: I4649b18c4721a5511a404299e771e675c843407b
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/PathCache.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp
index 0f22bea..367c627 100644
--- a/libs/hwui/PathCache.cpp
+++ b/libs/hwui/PathCache.cpp
@@ -44,7 +44,9 @@ void PathCache::remove(SkPath* path) {
mCache.setOnEntryRemovedListener(NULL);
for (size_t i = 0; i < pathsToRemove.size(); i++) {
- mCache.removeAt(pathsToRemove.itemAt(i));
+ // This will work because pathsToRemove is sorted
+ // and because the cache is a sorted keyed vector
+ mCache.removeAt(pathsToRemove.itemAt(i) - i);
}
mCache.setOnEntryRemovedListener(this);
}