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

Unified Diff: src/gpu/GrGpuResourceCacheAccess.h

Issue 858123002: Add specialized content key class for resources. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove default template arg Created 5 years, 11 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/GrGpuResource.cpp ('k') | src/gpu/GrPath.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpuResourceCacheAccess.h
diff --git a/src/gpu/GrGpuResourceCacheAccess.h b/src/gpu/GrGpuResourceCacheAccess.h
index d7c5028b202c5b3f31cd8da09060673dd2e8155f..33fe1ad93a36cc58e4dca4e6b30d233c07d39d2d 100644
--- a/src/gpu/GrGpuResourceCacheAccess.h
+++ b/src/gpu/GrGpuResourceCacheAccess.h
@@ -24,7 +24,7 @@ public:
* resource that currently is using the content key, allow resources' content keys to change,
* and allow removal of a content key to convert a resource back to scratch.
*/
- bool setContentKey(const GrResourceKey& contentKey) {
+ bool setContentKey(const GrContentKey& contentKey) {
return fResource->setContentKey(contentKey);
}
@@ -33,7 +33,7 @@ public:
* not have a content key.
*/
bool isScratch() const {
- return NULL == this->getContentKey() && fResource->fScratchKey.isValid();
+ return !this->getContentKey().isValid() && fResource->fScratchKey.isValid();
}
/**
@@ -52,12 +52,7 @@ public:
/**
* If the resource is currently cached by a content key, the key is returned, otherwise NULL.
*/
- const GrResourceKey* getContentKey() const {
- if (fResource->fFlags & GrGpuResource::kContentKeySet_Flag) {
- return &fResource->fContentKey;
- }
- return NULL;
- }
+ const GrContentKey& getContentKey() const { return fResource->fContentKey; }
/**
* Is the resource object wrapping an externally allocated GPU resource?
« no previous file with comments | « src/gpu/GrGpuResource.cpp ('k') | src/gpu/GrPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698