summaryrefslogtreecommitdiffstats
path: root/libs/hwui/PathCache.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2013-03-20 19:15:02 -0700
committerRomain Guy <romainguy@google.com>2013-03-20 19:16:53 -0700
commitc5cbee7d78513527e89450e6369a30a04b2d5e7a (patch)
treea3709dd93124509c4490b889622b277d11fbef30 /libs/hwui/PathCache.cpp
parent9eac52698b18d089e73c7ec2bf73a64a39504733 (diff)
downloadframeworks_base-c5cbee7d78513527e89450e6369a30a04b2d5e7a.zip
frameworks_base-c5cbee7d78513527e89450e6369a30a04b2d5e7a.tar.gz
frameworks_base-c5cbee7d78513527e89450e6369a30a04b2d5e7a.tar.bz2
Stop worker threads on memory trim & fix bad pointer access
Change-Id: I6fe7e31aeb6dd41fa65ab952caed97bc2da510d7
Diffstat (limited to 'libs/hwui/PathCache.cpp')
-rw-r--r--libs/hwui/PathCache.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp
index 490c22a..07c4207 100644
--- a/libs/hwui/PathCache.cpp
+++ b/libs/hwui/PathCache.cpp
@@ -347,14 +347,15 @@ void PathCache::PathProcessor::onProcess(const sp<Task<SkBitmap*> >& task) {
// Paths
///////////////////////////////////////////////////////////////////////////////
-void PathCache::remove(SkPath* path) {
+void PathCache::remove(const path_pair_t& pair) {
Vector<PathDescription> pathsToRemove;
LruCache<PathDescription, PathTexture*>::Iterator i(mCache);
while (i.next()) {
const PathDescription& key = i.key();
if (key.type == kShapePath &&
- (key.shape.path.mPath == path || key.shape.path.mPath == path->getSourcePath())) {
+ (key.shape.path.mPath == pair.getFirst() ||
+ key.shape.path.mPath == pair.getSecond())) {
pathsToRemove.push(key);
}
}
@@ -366,7 +367,7 @@ void PathCache::remove(SkPath* path) {
void PathCache::removeDeferred(SkPath* path) {
Mutex::Autolock l(mLock);
- mGarbage.push(path);
+ mGarbage.push(path_pair_t(path, const_cast<SkPath*>(path->getSourcePath())));
}
void PathCache::clearGarbage() {