diff options
Diffstat (limited to 'libs/hwui/ResourceCache.cpp')
-rw-r--r-- | libs/hwui/ResourceCache.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libs/hwui/ResourceCache.cpp b/libs/hwui/ResourceCache.cpp index 1c93ea6..00de39b 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); } |