diff options
author | bsalomon <bsalomon@google.com> | 2015-01-23 04:24:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-23 04:24:05 -0800 |
commit | 24db3b1c35fb935660229da164fc5ad31977387f (patch) | |
tree | be22e794f54605ff37ef09df79b3e0869572b053 /src/gpu/GrGpuResourceCacheAccess.h | |
parent | f98f2bb0e72df68320f707c8584e3c877ce98ec3 (diff) |
Add specialized content key class for resources.
Review URL: https://codereview.chromium.org/858123002
Diffstat (limited to 'src/gpu/GrGpuResourceCacheAccess.h')
-rw-r--r-- | src/gpu/GrGpuResourceCacheAccess.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/gpu/GrGpuResourceCacheAccess.h b/src/gpu/GrGpuResourceCacheAccess.h index d7c5028b20..33fe1ad93a 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? |