diff options
author | 2010-12-01 11:23:13 -0800 | |
---|---|---|
committer | 2010-12-14 16:50:50 -0800 | |
commit | e4ac2d6b5723c95e648c489b187ddde449452c13 (patch) | |
tree | a783470220e1840761dc6696f3e5f4cc7870054b /libs/hwui/ResourceCache.cpp | |
parent | 89f8d63a991f2dc4a961ad92ab5bb6b6c1ecd60f (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.cpp | 8 |
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); } |