Chromium Code Reviews

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.
Jump to:
View side-by-side diff with in-line comments
« 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