From a35778c799e8073a42b9e22191bde9d838327ab7 Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 6 Nov 2014 09:45:10 -0800 Subject: 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 --- libs/hwui/ResourceCache.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libs/hwui/ResourceCache.h') diff --git a/libs/hwui/ResourceCache.h b/libs/hwui/ResourceCache.h index 8539d12..a922d53 100644 --- a/libs/hwui/ResourceCache.h +++ b/libs/hwui/ResourceCache.h @@ -22,6 +22,7 @@ #include #include +#include #include @@ -53,11 +54,14 @@ public: ResourceType resourceType; }; -class ANDROID_API ResourceCache { -public: +class ANDROID_API ResourceCache: public Singleton { ResourceCache(); ~ResourceCache(); + friend class Singleton; + +public: + /** * When using these two methods, make sure to only invoke the *Locked() * variants of increment/decrementRefcount(), recyle() and destructor() -- cgit v1.1