summaryrefslogtreecommitdiffstats
path: root/libs/hwui/ResourceCache.cpp
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2010-10-25 15:47:32 -0700
committerChet Haase <chet@google.com>2010-10-26 06:54:55 -0700
commitd98aa2de9ab18e09c2be1997f41212740f51f6e6 (patch)
tree04bf505226c6a38fde7a466e28154e006e806f30 /libs/hwui/ResourceCache.cpp
parent9bb127869666be6507fb5c4b37b7d1965c7e5fa6 (diff)
downloadframeworks_base-d98aa2de9ab18e09c2be1997f41212740f51f6e6.zip
frameworks_base-d98aa2de9ab18e09c2be1997f41212740f51f6e6.tar.gz
frameworks_base-d98aa2de9ab18e09c2be1997f41212740f51f6e6.tar.bz2
DisplayList optimizations and fixes.
We now use a copy of SkPaint objects to avoid having it changed from under us. We reuse copies that have not changed. We also copy the SkMatrix every time to avoid the same problem. Change-Id: If3fd80698f2d43ea16d23302063e0fd8d0549027
Diffstat (limited to 'libs/hwui/ResourceCache.cpp')
-rw-r--r--libs/hwui/ResourceCache.cpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/libs/hwui/ResourceCache.cpp b/libs/hwui/ResourceCache.cpp
index 20b8d6c..b0fbe65 100644
--- a/libs/hwui/ResourceCache.cpp
+++ b/libs/hwui/ResourceCache.cpp
@@ -62,14 +62,6 @@ void ResourceCache::incrementRefcount(SkBitmap* bitmapResource) {
incrementRefcount((void*)bitmapResource, kBitmap);
}
-void ResourceCache::incrementRefcount(SkMatrix* matrixResource) {
- incrementRefcount((void*)matrixResource, kMatrix);
-}
-
-void ResourceCache::incrementRefcount(SkPaint* paintResource) {
- incrementRefcount((void*)paintResource, kPaint);
-}
-
void ResourceCache::incrementRefcount(SkiaShader* shaderResource) {
shaderResource->getSkShader()->safeRef();
incrementRefcount((void*)shaderResource, kShader);
@@ -136,34 +128,6 @@ void ResourceCache::destructor(SkBitmap* resource) {
}
}
-void ResourceCache::destructor(SkMatrix* resource) {
- ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
- if (ref == NULL) {
- // If we're not tracking this resource, just delete it
- delete resource;
- return;
- }
- ref->destroyed = true;
- if (ref->refCount == 0) {
- deleteResourceReference(resource, ref);
- return;
- }
-}
-
-void ResourceCache::destructor(SkPaint* resource) {
- ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
- if (ref == NULL) {
- // If we're not tracking this resource, just delete it
- delete resource;
- return;
- }
- ref->destroyed = true;
- if (ref->refCount == 0) {
- deleteResourceReference(resource, ref);
- return;
- }
-}
-
void ResourceCache::destructor(SkiaShader* resource) {
ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
if (ref == NULL) {
@@ -196,12 +160,6 @@ void ResourceCache::deleteResourceReference(void* resource, ResourceReference* r
delete bitmap;
}
break;
- case kMatrix:
- delete (SkMatrix*) resource;
- break;
- case kPaint:
- delete (SkPaint*) resource;
- break;
case kShader:
SkiaShader* shader = (SkiaShader*)resource;
if (Caches::hasInstance()) {