summaryrefslogtreecommitdiff
path: root/libs/hwui/ResourceCache.cpp
diff options
context:
space:
mode:
author Patrick Dubroy <dubroy@google.com> 2010-12-19 16:47:17 -0800
committer Patrick Dubroy <dubroy@google.com> 2010-12-20 17:02:15 -0800
commitf890fab5a6715548e520a6f010a3bfe7607ce56e (patch)
tree6c61a1b736399a9dde6b83f4978ad5ef36e18a95 /libs/hwui/ResourceCache.cpp
parent2a1cc5ac30efc05880a12a2114c09364fc38e032 (diff)
Ensure bitmaps aren't freed while referenced from a display list
Also removes the reference queue finalizers. They aren't necessary anymore now that Bitmaps are allocated in the heap.
Diffstat (limited to 'libs/hwui/ResourceCache.cpp')
-rw-r--r--libs/hwui/ResourceCache.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/libs/hwui/ResourceCache.cpp b/libs/hwui/ResourceCache.cpp
index 1c93ea644ef4..00de39b3068b 100644
--- a/libs/hwui/ResourceCache.cpp
+++ b/libs/hwui/ResourceCache.cpp
@@ -60,9 +60,7 @@ void ResourceCache::incrementRefcount(void* resource, ResourceType resourceType)
}
void ResourceCache::incrementRefcount(SkBitmap* bitmapResource) {
- SkPixelRef* pixref = bitmapResource->pixelRef();
- if (pixref) pixref->globalRef();
-
+ bitmapResource->pixelRef()->safeRef();
bitmapResource->getColorTable()->safeRef();
incrementRefcount((void*)bitmapResource, kBitmap);
}
@@ -91,9 +89,7 @@ void ResourceCache::decrementRefcount(void* resource) {
}
void ResourceCache::decrementRefcount(SkBitmap* bitmapResource) {
- SkPixelRef* pixref = bitmapResource->pixelRef();
- if (pixref) pixref->globalUnref();
-
+ bitmapResource->pixelRef()->safeUnref();
bitmapResource->getColorTable()->safeUnref();
decrementRefcount((void*)bitmapResource);
}