aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrResourceCache.h
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-09 14:44:15 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-09 14:44:15 +0000
commit9fbcad0f00d7098574cf3394a812c9d845c9cc5b (patch)
tree7cc1373d7288d7ba373caf108745e9aa311fc838 /src/gpu/GrResourceCache.h
parent3590a248bb110a5346b6e2cbdda5cc3345cbe01b (diff)
Removed old resource locking system
Diffstat (limited to 'src/gpu/GrResourceCache.h')
-rw-r--r--src/gpu/GrResourceCache.h38
1 files changed, 4 insertions, 34 deletions
diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h
index e6b412e48d..7897b7ae47 100644
--- a/src/gpu/GrResourceCache.h
+++ b/src/gpu/GrResourceCache.h
@@ -156,20 +156,9 @@ private:
GrResourceEntry(const GrResourceKey& key, GrResource* resource);
~GrResourceEntry();
- bool isLocked() const { return fLockCount != 0; }
- void lock() { ++fLockCount; }
- void unlock() {
- GrAssert(fLockCount > 0);
- --fLockCount;
- }
-
GrResourceKey fKey;
GrResource* fResource;
- // track if we're in use, used when we need to purge
- // we only purge unlocked entries
- int fLockCount;
-
// we're a dlinklist
SK_DEFINE_DLINKEDLIST_INTERFACE(GrResourceEntry);
@@ -238,19 +227,13 @@ public:
GrResource* find(const GrResourceKey& key);
/**
- * Search for an entry with the same Key. If found, "lock" it and return it.
- * If not found, return null.
- */
- GrResource* findAndLock(const GrResourceKey&);
-
- /**
* Create a new cache entry, based on the provided key and resource, and
* return it.
*
* Ownership of the resource is transferred to the resource cache,
* which will unref() it when it is purged or deleted.
*/
- void createAndLock(const GrResourceKey&, GrResource*);
+ void create(const GrResourceKey&, GrResource*);
/**
* Determines if the cache contains an entry matching a key. If a matching
@@ -273,23 +256,14 @@ public:
void makeNonExclusive(GrResourceEntry* entry);
/**
- * When done with an entry, call unlock(entry) on it, which returns it to
- * a purgable state.
- */
- void unlock(GrResourceEntry*);
-
- /**
- * Make a resource un-purgeable.
- */
- void lock(GrResourceEntry* entry);
-
- /**
* Removes every resource in the cache that isn't locked.
*/
void purgeAllUnlocked();
/**
* Allow cache to purge unused resources to obey resource limitations
+ * Note: this entry point will be hidden (again) once totally ref-driven
+ * cache maintenance is implemented
*/
void purgeAsNeeded();
@@ -300,7 +274,7 @@ public:
#endif
#if GR_CACHE_STATS
- void printStats() const;
+ void printStats();
#endif
private:
@@ -328,14 +302,12 @@ private:
// our current stats, related to our budget
#if GR_CACHE_STATS
int fHighWaterEntryCount;
- int fHighWaterUnlockedEntryCount;
size_t fHighWaterEntryBytes;
int fHighWaterClientDetachedCount;
size_t fHighWaterClientDetachedBytes;
#endif
int fEntryCount;
- int fUnlockedEntryCount;
size_t fEntryBytes;
int fClientDetachedCount;
size_t fClientDetachedBytes;
@@ -343,8 +315,6 @@ private:
// prevents recursive purging
bool fPurging;
- void create(const GrResourceKey& key, GrResource* resource);
-
#if GR_DEBUG
static size_t countBytes(const SkTDLinkedList<GrResourceEntry>& list);
#endif