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

Unified Diff: include/gpu/GrGpuResource.h

Issue 921323002: Make GrResourceCache use a priority queue of purgeable resources. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 5 years, 10 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 | « no previous file | src/core/SkTDPQueue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrGpuResource.h
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h
index baffd9ec8343bf04f9c716558003ddbf06b302ec..7774f734f8373661279e47419073ec0552bdd2c6 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;
« no previous file with comments | « no previous file | src/core/SkTDPQueue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698