aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrGpuResource.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-01-23 04:24:04 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-23 04:24:05 -0800
commit24db3b1c35fb935660229da164fc5ad31977387f (patch)
treebe22e794f54605ff37ef09df79b3e0869572b053 /include/gpu/GrGpuResource.h
parentf98f2bb0e72df68320f707c8584e3c877ce98ec3 (diff)
Add specialized content key class for resources.
Diffstat (limited to 'include/gpu/GrGpuResource.h')
-rw-r--r--include/gpu/GrGpuResource.h25
1 files changed, 8 insertions, 17 deletions
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h
index 750ec6a440..d6abc4d12c 100644
--- a/include/gpu/GrGpuResource.h
+++ b/include/gpu/GrGpuResource.h
@@ -259,7 +259,7 @@ private:
virtual size_t onGpuMemorySize() const = 0;
// See comments in CacheAccess.
- bool setContentKey(const GrResourceKey& contentKey);
+ bool setContentKey(const GrContentKey& contentKey);
void notifyIsPurgable() const;
void removeScratchKey();
void makeBudgeted();
@@ -275,27 +275,18 @@ private:
static const size_t kInvalidGpuMemorySize = ~static_cast<size_t>(0);
- enum Flags {
- /**
- * If set then fContentKey is valid and the resource is cached based on its content.
- */
- kContentKeySet_Flag = 0x1,
- };
-
- GrScratchKey fScratchKey;
- // TODO(bsalomon): Remove GrResourceKey and use different simpler type for content keys.
- GrResourceKey fContentKey;
+ GrScratchKey fScratchKey;
+ GrContentKey fContentKey;
// This is not ref'ed but abandon() or release() will be called before the GrGpu object
// is destroyed. Those calls set will this to NULL.
- GrGpu* fGpu;
- mutable size_t fGpuMemorySize;
+ GrGpu* fGpu;
+ mutable size_t fGpuMemorySize;
- uint32_t fFlags;
- LifeCycle fLifeCycle;
- const uint32_t fUniqueID;
+ LifeCycle fLifeCycle;
+ const uint32_t fUniqueID;
- SkAutoTUnref<const SkData> fData;
+ SkAutoTUnref<const SkData> fData;
typedef GrIORef<GrGpuResource> INHERITED;
friend class GrIORef<GrGpuResource>; // to access notifyIsPurgable.