diff options
author | bsalomon <bsalomon@google.com> | 2015-02-17 11:47:40 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-17 11:47:41 -0800 |
commit | 9f2d1571ed1f0ed579e5d7779c46a90e20f30f22 (patch) | |
tree | f2106bb579bcb7cc7498818a4441b4ecff53d875 /include/gpu/GrGpuResource.h | |
parent | 9e779d495130009926fc5394a8971eec20494e5f (diff) |
Make GrResourceCache use a priority queue of purgeable resources.
Review URL: https://codereview.chromium.org/921323002
Diffstat (limited to 'include/gpu/GrGpuResource.h')
-rw-r--r-- | include/gpu/GrGpuResource.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h index baffd9ec83..7774f734f8 100644 --- a/include/gpu/GrGpuResource.h +++ b/include/gpu/GrGpuResource.h @@ -269,7 +269,7 @@ private: virtual size_t onGpuMemorySize() const = 0; - // See comments in CacheAccess. + // See comments in CacheAccess and ResourcePriv. bool setContentKey(const GrContentKey& contentKey); void removeContentKey(); void notifyIsPurgeable() const; @@ -283,9 +283,15 @@ private: static uint32_t CreateUniqueID(); - // We're in an internal doubly linked list owned by GrResourceCache + // We're in an internal doubly linked list owned by GrResourceCache. TODO: Replace this with an + // array of unpurgeable resources in the cache. SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrGpuResource); + // An index into a heap when this resource is purgeable. This is maintained by the cache. + int fCacheArrayIndex; + // This value reflects how recently this resource was accessed in the cache. This is maintained + // by the cache. + uint32_t fTimestamp; static const size_t kInvalidGpuMemorySize = ~static_cast<size_t>(0); GrScratchKey fScratchKey; |