| Index: include/gpu/GrGpuResource.h
|
| diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h
|
| index 315e491a86ff4f2063c141bf96e5116e2da76840..3d6701a7026e7f124932d7985177e868f4679300 100644
|
| --- a/include/gpu/GrGpuResource.h
|
| +++ b/include/gpu/GrGpuResource.h
|
| @@ -174,24 +174,6 @@ public:
|
| */
|
| virtual size_t gpuMemorySize() const = 0;
|
|
|
| - // TODO(bsalomon): Move this stuff to GrGpuResourcePriv.
|
| - bool setContentKey(const GrResourceKey& contentKey);
|
| - void setCacheEntry(GrResourceCacheEntry* cacheEntry);
|
| - GrResourceCacheEntry* getCacheEntry() const { return fCacheEntry; }
|
| - bool isScratch() const;
|
| - /**
|
| - * If this resource can be used as a scratch resource this returns a valid
|
| - * scratch key. Otherwise it returns a key for which isNullScratch is true.
|
| - * The resource may currently be used as content resource rather than scratch.
|
| - * Check isScratch().
|
| - */
|
| - const GrResourceKey& getScratchKey() const { return fScratchKey; }
|
| - /**
|
| - * If this resource is currently cached by its contents then this will return
|
| - * the content key. Otherwise, NULL is returned.
|
| - */
|
| - const GrResourceKey* getContentKey() const;
|
| -
|
| /**
|
| * Gets an id that is unique for this GrGpuResource object. It is static in that it does
|
| * not change when the content of the GrGpuResource object changes. This will never return
|
| @@ -199,6 +181,13 @@ public:
|
| */
|
| uint32_t getUniqueID() const { return fUniqueID; }
|
|
|
| + /**
|
| + * Internal-only helper class used for cache manipulations of the reosurce.
|
| + */
|
| + class CacheAccess;
|
| + inline CacheAccess cacheAccess();
|
| + inline const CacheAccess cacheAccess() const;
|
| +
|
| protected:
|
| // This must be called by every GrGpuObject. It should be called once the object is fully
|
| // initialized (i.e. not in a base class constructor).
|
| @@ -207,8 +196,6 @@ protected:
|
| GrGpuResource(GrGpu*, bool isWrapped);
|
| virtual ~GrGpuResource();
|
|
|
| - bool isInCache() const { return SkToBool(fCacheEntry); }
|
| -
|
| GrGpu* getGpu() const { return fGpu; }
|
|
|
| // Derived classes should always call their parent class' onRelease
|
| @@ -233,6 +220,9 @@ protected:
|
| void setScratchKey(const GrResourceKey& scratchKey);
|
|
|
| private:
|
| + // See comments in CacheAccess.
|
| + bool setContentKey(const GrResourceKey& contentKey);
|
| +
|
| void notifyIsPurgable() const;
|
|
|
| #ifdef SK_DEBUG
|
|
|