diff options
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 |
commit | f890fab5a6715548e520a6f010a3bfe7607ce56e (patch) | |
tree | 6c61a1b736399a9dde6b83f4978ad5ef36e18a95 /libs | |
parent | 2a1cc5ac30efc05880a12a2114c09364fc38e032 (diff) | |
download | frameworks_base-f890fab5a6715548e520a6f010a3bfe7607ce56e.zip frameworks_base-f890fab5a6715548e520a6f010a3bfe7607ce56e.tar.gz frameworks_base-f890fab5a6715548e520a6f010a3bfe7607ce56e.tar.bz2 |
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')
-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); } |