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

Unified Diff: src/gpu/GrGpuResourceCacheAccess.h

Issue 2361093002: Change implementation of flush-count based GrGpuResource purging (Closed)
Patch Set: fix var spelling Created 4 years, 3 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 | « src/gpu/GrGpuResource.cpp ('k') | src/gpu/GrResourceCache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpuResourceCacheAccess.h
diff --git a/src/gpu/GrGpuResourceCacheAccess.h b/src/gpu/GrGpuResourceCacheAccess.h
index b09dcc1872c6b4133e4746d0d2859814e88b3a55..e91f899cf2b84c7a97145c873ce84e78516b528f 100644
--- a/src/gpu/GrGpuResourceCacheAccess.h
+++ b/src/gpu/GrGpuResourceCacheAccess.h
@@ -58,6 +58,20 @@ private:
uint32_t timestamp() const { return fResource->fTimestamp; }
void setTimestamp(uint32_t ts) { fResource->fTimestamp = ts; }
+ /** Called by the cache to record when this became purgeable. */
+ void setFlushCntWhenResourceBecamePurgeable(uint32_t cnt) {
+ SkASSERT(fResource->isPurgeable());
+ fResource->fExternalFlushCntWhenBecamePurgeable = cnt;
+ }
+ /**
+ * Called by the cache to determine whether this resource has been puregable for more than
+ * a threshold number of external flushes.
+ */
+ uint32_t flushCntWhenResourceBecamePurgeable() {
+ SkASSERT(fResource->isPurgeable());
+ return fResource->fExternalFlushCntWhenBecamePurgeable;
+ }
+
int* accessCacheIndex() const { return &fResource->fCacheArrayIndex; }
CacheAccess(GrGpuResource* resource) : fResource(resource) {}
« no previous file with comments | « src/gpu/GrGpuResource.cpp ('k') | src/gpu/GrResourceCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698