summaryrefslogtreecommitdiff
path: root/libs/hwui/ResourceCache.h
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2014-11-06 09:45:10 -0800
committer John Reck <jreck@google.com> 2014-11-06 09:45:10 -0800
commita35778c799e8073a42b9e22191bde9d838327ab7 (patch)
treef4d74fc026f8dcf6d8ea8e5a18be30a14b990b70 /libs/hwui/ResourceCache.h
parentb9744c1c1f5e8cc936da7f1832665f77ad5bb18f (diff)
Yank ResourceCache out of Caches
Bug: 17947547 Pull the ResourceCache (aka, ref-counting side channel) out of Caches so that DisplayListRenderer doesn't use Caches, avoiding the risk of instantiating Caches on the wrong thread or without a GL context Change-Id: I7d63b70b3b0a0163308c5dedd6ef255eadebe8fd
Diffstat (limited to 'libs/hwui/ResourceCache.h')
-rw-r--r--libs/hwui/ResourceCache.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/hwui/ResourceCache.h b/libs/hwui/ResourceCache.h
index 8539d123b09a..a922d53ed816 100644
--- a/libs/hwui/ResourceCache.h
+++ b/libs/hwui/ResourceCache.h
@@ -22,6 +22,7 @@
#include <SkBitmap.h>
#include <utils/KeyedVector.h>
+#include <utils/Singleton.h>
#include <androidfw/ResourceTypes.h>
@@ -53,11 +54,14 @@ public:
ResourceType resourceType;
};
-class ANDROID_API ResourceCache {
-public:
+class ANDROID_API ResourceCache: public Singleton<ResourceCache> {
ResourceCache();
~ResourceCache();
+ friend class Singleton<ResourceCache>;
+
+public:
+
/**
* When using these two methods, make sure to only invoke the *Locked()
* variants of increment/decrementRefcount(), recyle() and destructor()