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) {} |