summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2013-07-02 10:48:54 -0700
committerChris Craik <ccraik@google.com>2013-07-08 11:08:02 -0700
commit0c20c3898a533b7b76f60827cb6ea02e17c5953d (patch)
tree15a488db02872005937082b918bfe108eeae1282 /libs/hwui
parente969964c80a20b2d968b4ee54495176c9049d3e3 (diff)
downloadframeworks_base-0c20c3898a533b7b76f60827cb6ea02e17c5953d.zip
frameworks_base-0c20c3898a533b7b76f60827cb6ea02e17c5953d.tar.gz
frameworks_base-0c20c3898a533b7b76f60827cb6ea02e17c5953d.tar.bz2
Use global references for Bitmap AndroidPixelRefs
bug:9621717 Because we're no longer holding onto Bitmaps Java side during DisplayList lifetime, use global refs to keep the backing byte arrays around. Adds back bitmap buffer passing + native ref management removed by 3b748a44c6bd2ea05fe16839caf73dbe50bd7ae9 Adds back globalRef-ing removed by f890fab5a6715548e520a6f010a3bfe7607ce56e Change-Id: Ia59ba42f05bea6165aec2b800619221a8083d580
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/ResourceCache.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/hwui/ResourceCache.cpp b/libs/hwui/ResourceCache.cpp
index 58fa21c..3f77021 100644
--- a/libs/hwui/ResourceCache.cpp
+++ b/libs/hwui/ResourceCache.cpp
@@ -62,7 +62,7 @@ void ResourceCache::incrementRefcount(void* resource, ResourceType resourceType)
}
void ResourceCache::incrementRefcount(SkBitmap* bitmapResource) {
- SkSafeRef(bitmapResource->pixelRef());
+ bitmapResource->pixelRef()->globalRef();
SkSafeRef(bitmapResource->getColorTable());
incrementRefcount((void*) bitmapResource, kBitmap);
}
@@ -100,7 +100,7 @@ void ResourceCache::incrementRefcountLocked(void* resource, ResourceType resourc
}
void ResourceCache::incrementRefcountLocked(SkBitmap* bitmapResource) {
- SkSafeRef(bitmapResource->pixelRef());
+ bitmapResource->pixelRef()->globalRef();
SkSafeRef(bitmapResource->getColorTable());
incrementRefcountLocked((void*) bitmapResource, kBitmap);
}
@@ -133,7 +133,7 @@ void ResourceCache::decrementRefcount(void* resource) {
}
void ResourceCache::decrementRefcount(SkBitmap* bitmapResource) {
- SkSafeUnref(bitmapResource->pixelRef());
+ bitmapResource->pixelRef()->globalUnref();
SkSafeUnref(bitmapResource->getColorTable());
decrementRefcount((void*) bitmapResource);
}
@@ -174,7 +174,7 @@ void ResourceCache::decrementRefcountLocked(void* resource) {
}
void ResourceCache::decrementRefcountLocked(SkBitmap* bitmapResource) {
- SkSafeUnref(bitmapResource->pixelRef());
+ bitmapResource->pixelRef()->globalUnref();
SkSafeUnref(bitmapResource->getColorTable());
decrementRefcountLocked((void*) bitmapResource);
}