| Index: include/gpu/GrCacheable.h
|
| diff --git a/include/gpu/GrCacheable.h b/include/gpu/GrCacheable.h
|
| index 39c62b1b66c730ba130303c7bafb2b9733af7ce6..344ae6b58319edd1e41fe7222ef0087a188c79e3 100644
|
| --- a/include/gpu/GrCacheable.h
|
| +++ b/include/gpu/GrCacheable.h
|
| @@ -41,8 +41,17 @@ public:
|
| void setCacheEntry(GrResourceCacheEntry* cacheEntry) { fCacheEntry = cacheEntry; }
|
| GrResourceCacheEntry* getCacheEntry() { return fCacheEntry; }
|
|
|
| + /**
|
| + * Gets an id that is unique for this GrCacheable object. It is static in that it does
|
| + * not change when the content of the GrCacheable object changes. This will never return
|
| + * 0.
|
| + */
|
| + uint32_t getGenerationID() const;
|
| +
|
| protected:
|
| - GrCacheable() : fCacheEntry(NULL) {}
|
| + GrCacheable()
|
| + : fCacheEntry(NULL)
|
| + , fGenID(0) {}
|
|
|
| bool isInCache() const { return NULL != fCacheEntry; }
|
|
|
| @@ -55,7 +64,8 @@ protected:
|
| void didChangeGpuMemorySize() const;
|
|
|
| private:
|
| - GrResourceCacheEntry* fCacheEntry; // NULL if not in cache
|
| + GrResourceCacheEntry* fCacheEntry; // NULL if not in cache
|
| + mutable uint32_t fGenID;
|
|
|
| typedef SkRefCnt INHERITED;
|
| };
|
|
|