Index: include/gpu/GrCacheable.h |
diff --git a/include/gpu/GrCacheable.h b/include/gpu/GrCacheable.h |
index 0efc7f7d61e805ada59ace13c873dd23a9536aa8..6c97cb9f7240d06080b7d022592f97f62dfafb68 100644 |
--- a/include/gpu/GrCacheable.h |
+++ b/include/gpu/GrCacheable.h |
@@ -62,13 +62,13 @@ public: |
* not change when the content of the GrCacheable object changes. This will never return |
* 0. |
*/ |
- uint32_t getGenerationID() const; |
+ uint32_t getUniqueID() const { return fUniqueID; } |
protected: |
GrCacheable() |
: fRefCnt(1) |
, fCacheEntry(NULL) |
- , fGenID(0) {} |
+ , fUniqueID(CreateUniqueID()) {} |
bool isInCache() const { return NULL != fCacheEntry; } |
@@ -81,9 +81,11 @@ protected: |
void didChangeGpuMemorySize() const; |
private: |
+ static uint32_t CreateUniqueID(); |
+ |
mutable int32_t fRefCnt; |
GrResourceCacheEntry* fCacheEntry; // NULL if not in cache |
robertphillips
2014/07/22 18:15:46
Does this need to be mutable? Can it be const?
bsalomon
2014/07/22 18:48:44
nope, should be const
|
- mutable uint32_t fGenID; |
+ mutable uint32_t fUniqueID; |
typedef SkNoncopyable INHERITED; |
}; |