summaryrefslogtreecommitdiff
path: root/libs/hwui/ResourceCache.cpp
diff options
context:
space:
mode:
author Patrick Dubroy <dubroy@google.com> 2010-12-14 16:56:07 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2010-12-14 16:56:07 -0800
commit982b71bf4713d57b0fdb9acaaf9f9465a817aacb (patch)
tree211deba434e54321f1427f3e3d1d2057213aae57 /libs/hwui/ResourceCache.cpp
parent52e08834094aef141c1352c601415132785f533d (diff)
parente4ac2d6b5723c95e648c489b187ddde449452c13 (diff)
Merge "Allocate bitmap backing buffers in the Java heap."
Diffstat (limited to 'libs/hwui/ResourceCache.cpp')
-rw-r--r--libs/hwui/ResourceCache.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/hwui/ResourceCache.cpp b/libs/hwui/ResourceCache.cpp
index 00de39b3068b..1c93ea644ef4 100644
--- a/libs/hwui/ResourceCache.cpp
+++ b/libs/hwui/ResourceCache.cpp
@@ -60,7 +60,9 @@ void ResourceCache::incrementRefcount(void* resource, ResourceType resourceType)
}
void ResourceCache::incrementRefcount(SkBitmap* bitmapResource) {
- bitmapResource->pixelRef()->safeRef();
+ SkPixelRef* pixref = bitmapResource->pixelRef();
+ if (pixref) pixref->globalRef();
+
bitmapResource->getColorTable()->safeRef();
incrementRefcount((void*)bitmapResource, kBitmap);
}
@@ -89,7 +91,9 @@ void ResourceCache::decrementRefcount(void* resource) {
}
void ResourceCache::decrementRefcount(SkBitmap* bitmapResource) {
- bitmapResource->pixelRef()->safeUnref();
+ SkPixelRef* pixref = bitmapResource->pixelRef();
+ if (pixref) pixref->globalUnref();
+
bitmapResource->getColorTable()->safeUnref();
decrementRefcount((void*)bitmapResource);
}