Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: src/gpu/GrResourceCache.h

Issue 707493002: Use GrResourceCache2 to service content key lookups (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move #ifdef SK_SUPPORT_GPU Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrGpuResource.cpp ('k') | src/gpu/GrResourceCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceCache.h
diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h
index f6d064af395be1f44691c4d326efc676ca70db88..874f16ac63d9932d7fbdf9e72bf0a2b1801b87b9 100644
--- a/src/gpu/GrResourceCache.h
+++ b/src/gpu/GrResourceCache.h
@@ -140,12 +140,6 @@ public:
*/
int getCachedResourceCount() const { return fEntryCount; }
- /**
- * Search for an entry with the same Key. If found, return it.
- * If not found, return null.
- */
- GrGpuResource* find(const GrResourceKey& key);
-
void makeResourceMRU(GrGpuResource*);
/** Called by GrGpuResources when they detects that they are newly purgable. */
@@ -157,14 +151,11 @@ public:
*
* Ownership of the resource is transferred to the resource cache,
* which will unref() it when it is purged or deleted.
+ *
+ * This can fail if the key is already taken, or the resource is already in
+ * the cache.
*/
- void addResource(const GrResourceKey& key, GrGpuResource* resource);
-
- /**
- * Determines if the cache contains an entry matching a key. If a matching
- * entry exists but was detached then it will not be found.
- */
- bool hasKey(const GrResourceKey& key) const { return SkToBool(fCache.find(key)); }
+ bool addResource(const GrResourceKey& key, GrGpuResource* resource);
/**
* Notify the cache that the size of a resource has changed.
« no previous file with comments | « src/gpu/GrGpuResource.cpp ('k') | src/gpu/GrResourceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698