summaryrefslogtreecommitdiff
path: root/libs/hwui/ResourceCache.cpp
diff options
context:
space:
mode:
author Patrick Dubroy <dubroy@google.com> 2010-12-01 11:23:13 -0800
committer Patrick Dubroy <dubroy@google.com> 2010-12-14 16:50:50 -0800
commite4ac2d6b5723c95e648c489b187ddde449452c13 (patch)
treea783470220e1840761dc6696f3e5f4cc7870054b /libs/hwui/ResourceCache.cpp
parent89f8d63a991f2dc4a961ad92ab5bb6b6c1ecd60f (diff)
Allocate bitmap backing buffers in the Java heap.
Change-Id: I60f6ccff13357c1c518e9d56b02fe0171637edd1
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);
}