diff options
Diffstat (limited to 'libs/hwui/ResourceCache.h')
-rw-r--r-- | libs/hwui/ResourceCache.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libs/hwui/ResourceCache.h b/libs/hwui/ResourceCache.h index 3864d4b..a922d53 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> @@ -36,8 +37,7 @@ namespace uirenderer { enum ResourceType { kBitmap, kNinePatch, - kPath, - kLayer + kPath }; class ResourceReference { @@ -54,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() @@ -69,22 +72,18 @@ public: void incrementRefcount(const SkPath* resource); void incrementRefcount(const SkBitmap* resource); void incrementRefcount(const Res_png_9patch* resource); - void incrementRefcount(Layer* resource); void incrementRefcountLocked(const SkPath* resource); void incrementRefcountLocked(const SkBitmap* resource); void incrementRefcountLocked(const Res_png_9patch* resource); - void incrementRefcountLocked(Layer* resource); void decrementRefcount(const SkBitmap* resource); void decrementRefcount(const SkPath* resource); void decrementRefcount(const Res_png_9patch* resource); - void decrementRefcount(Layer* resource); void decrementRefcountLocked(const SkBitmap* resource); void decrementRefcountLocked(const SkPath* resource); void decrementRefcountLocked(const Res_png_9patch* resource); - void decrementRefcountLocked(Layer* resource); void destructor(SkPath* resource); void destructor(const SkBitmap* resource); |