diff options
| author | 2011-02-24 19:50:26 -0800 | |
|---|---|---|
| committer | 2011-02-24 19:50:26 -0800 | |
| commit | 1b1b7c64784ee6c4756c9012d3d4ad74d44f768e (patch) | |
| tree | e4807b14fa45433586e841c71e95d3901fe5c2b4 /libs/hwui/PathCache.cpp | |
| parent | 50fc0e5c1bafb458ae9cd8cca6a3732828e821df (diff) | |
| parent | 7b8b75892400745f39bb8d5b5d539091bcfb1e1e (diff) | |
Merge "Remove the right entries from the cache when a GC happens."
Diffstat (limited to 'libs/hwui/PathCache.cpp')
| -rw-r--r-- | libs/hwui/PathCache.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp index 0f22bea48009..367c6275c711 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); } |