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

Unified Diff: src/gpu/GrGpuResourcePriv.h

Issue 938943002: Allow GrGpuResources' unique keys to be changed. (Closed) Base URL: https://skia.googlesource.com/skia.git@rename
Patch Set: Address comments Created 5 years, 10 months 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/GrGpuResourceCacheAccess.h ('k') | src/gpu/GrResourceCache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpuResourcePriv.h
diff --git a/src/gpu/GrGpuResourcePriv.h b/src/gpu/GrGpuResourcePriv.h
index 92c53daf0e2e443a52ae51e1fc5532c64ef1be86..5324dccc22ad2842d76dbda15df381cadc54022e 100644
--- a/src/gpu/GrGpuResourcePriv.h
+++ b/src/gpu/GrGpuResourcePriv.h
@@ -19,17 +19,15 @@ class GrGpuResource::ResourcePriv {
public:
/**
* Sets a unique key for the resource. If the resource was previously cached as scratch it will
- * be converted to a uniquely-keyed resource. Currently this may only be called once per
- * resource. It fails if there is already a resource with the same unique key. TODO: make this
- * supplant the resource that currently is using the unique key, allow resources' unique keys
- * to change, and allow removal of a unique key to convert a resource back to scratch.
+ * be converted to a uniquely-keyed resource. If the key is invalid then this is equivalent to
+ * removeUniqueKey(). If another resource is using the key then its unique key is removed and
+ * this resource takes over the key.
*/
- bool setUniqueKey(const GrUniqueKey& key) {
- return fResource->setUniqueKey(key);
- }
+ void setUniqueKey(const GrUniqueKey& key) { fResource->setUniqueKey(key); }
- /** Removes the unique key from a resource */
- void removeUniqueKey() { return fResource->removeUniqueKey(); }
+ /** Removes the unique key from a resource. If the resource has a scratch key, it may be
+ preserved for recycling as scratch. */
+ void removeUniqueKey() { fResource->removeUniqueKey(); }
/**
* If the resource is uncached make it cached. Has no effect on resources that are wrapped or
« no previous file with comments | « src/gpu/GrGpuResourceCacheAccess.h ('k') | src/gpu/GrResourceCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698