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.
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(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(SkBitmap* bitmapResource) {
- SkPixelRef* pixref = bitmapResource->pixelRef();
- if (pixref) pixref->globalUnref();
-
+ bitmapResource->pixelRef()->safeUnref();
bitmapResource->getColorTable()->safeUnref();
decrementRefcount((void*)bitmapResource);
}