diff options
author | Brian Salomon <bsalomon@google.com> | 2017-03-22 14:53:13 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-22 20:08:21 +0000 |
commit | 5e150851d0dd5ddb161449b44edf1bf52d18ac5a (patch) | |
tree | e081248e324c50b9ade1569fb3a5ac85450af40b /include/gpu/GrGpuResource.h | |
parent | b8e752198dde333e71cb1a9578cd3dfd404dd06c (diff) |
Revert "Revert "Add a new GrResourceCache purging mechanism for purging unused resources.""
This reverts commit 20c322ef0cd04cf8e2592879d05d9f4e6cb19596.
Change-Id: I6df9a8594484837672308dc2c21c7c29b76ffa2c
Reviewed-on: https://skia-review.googlesource.com/10013
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include/gpu/GrGpuResource.h')
-rw-r--r-- | include/gpu/GrGpuResource.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h index e0a7903f1d..2d84c633ee 100644 --- a/include/gpu/GrGpuResource.h +++ b/include/gpu/GrGpuResource.h @@ -315,28 +315,30 @@ private: void makeUnbudgeted(); #ifdef SK_DEBUG - friend class GrGpu; // for assert in GrGpu to access getGpu + friend class GrGpu; // for assert in GrGpu to access getGpu #endif + // An index into a heap when this resource is purgeable or an array when not. This is maintained // by the cache. - int fCacheArrayIndex; + int fCacheArrayIndex; // This value reflects how recently this resource was accessed in the cache. This is maintained // by the cache. - uint32_t fTimestamp; - uint32_t fExternalFlushCntWhenBecamePurgeable; + uint32_t fTimestamp; + uint32_t fExternalFlushCntWhenBecamePurgeable; + GrStdSteadyClock::time_point fTimeWhenBecamePurgeable; static const size_t kInvalidGpuMemorySize = ~static_cast<size_t>(0); - GrScratchKey fScratchKey; - GrUniqueKey fUniqueKey; + GrScratchKey fScratchKey; + GrUniqueKey fUniqueKey; // This is not ref'ed but abandon() or release() will be called before the GrGpu object // is destroyed. Those calls set will this to NULL. - GrGpu* fGpu; - mutable size_t fGpuMemorySize; + GrGpu* fGpu; + mutable size_t fGpuMemorySize; - SkBudgeted fBudgeted; - bool fRefsWrappedObjects; - const UniqueID fUniqueID; + SkBudgeted fBudgeted; + bool fRefsWrappedObjects; + const UniqueID fUniqueID; typedef GrIORef<GrGpuResource> INHERITED; friend class GrIORef<GrGpuResource>; // to access notifyAllCntsAreZero and notifyRefCntIsZero. |