Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: include/gpu/GrCacheable.h

Issue 414493002: Revert "Revert of Use the GrCacheable ID to eliminate the need for notifications to GrGpuGL when te… (Closed) Base URL: https://skia.googlesource.com/skia.git@removestuff
Patch Set: Address round 2 of comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkTypes.h ('k') | src/gpu/GrBitmapTextContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrCacheable.h
diff --git a/include/gpu/GrCacheable.h b/include/gpu/GrCacheable.h
index 0efc7f7d61e805ada59ace13c873dd23a9536aa8..cacc7e7c9a908b155185c0d797df9dc47a216e2a 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
- mutable uint32_t fGenID;
+ const uint32_t fUniqueID;
typedef SkNoncopyable INHERITED;
};
« no previous file with comments | « include/core/SkTypes.h ('k') | src/gpu/GrBitmapTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698