From f890fab5a6715548e520a6f010a3bfe7607ce56e Mon Sep 17 00:00:00 2001 From: Patrick Dubroy Date: Sun, 19 Dec 2010 16:47:17 -0800 Subject: 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. --- libs/hwui/ResourceCache.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'libs/hwui/ResourceCache.cpp') 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); } -- cgit v1.2.3-59-g8ed1b