Chromium Code Reviews| Index: src/gpu/GrResourceCache.h |
| diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h |
| index b2f91cdbdb8c81d75875eed43464604c0255545c..0489d33b83c47ea8026fc91523e9e0ded4e89952 100644 |
| --- a/src/gpu/GrResourceCache.h |
| +++ b/src/gpu/GrResourceCache.h |
| @@ -19,6 +19,7 @@ |
| #include "SkTInternalLList.h" |
| class GrCacheable; |
| +class GrResourceCache; |
| class GrResourceCacheEntry; |
| class GrResourceKey { |
| @@ -128,12 +129,19 @@ public: |
| void validate() const {} |
| #endif |
|
robertphillips
2014/04/29 13:46:25
// Inform the resource cache that this entry's siz
|
| + void didChangeResourceSize(); |
| + |
| private: |
| - GrResourceCacheEntry(const GrResourceKey& key, GrCacheable* resource); |
| + GrResourceCacheEntry(GrResourceCache* resourceCache, |
| + const GrResourceKey& key, |
| + GrCacheable* resource); |
| ~GrResourceCacheEntry(); |
| + GrResourceCache* fResourceCache; |
| GrResourceKey fKey; |
| GrCacheable* fResource; |
| + size_t fCachedSize; |
| + bool fIsExclusive; |
| // Linked list for the LRU ordering. |
| SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrResourceCacheEntry); |
| @@ -272,6 +280,12 @@ public: |
| void makeNonExclusive(GrResourceCacheEntry* entry); |
| /** |
| + * Notify the cache that the size of a resource has changed. |
| + */ |
|
robertphillips
2014/04/29 13:46:25
amountInc?
|
| + void didIncreaseResourceSize(const GrResourceCacheEntry*, size_t amount); |
| + void didDecreaseResourceSize(const GrResourceCacheEntry*, size_t amount); |
|
robertphillips
2014/04/29 13:46:25
amountDec?
|
| + |
| + /** |
| * Remove a resource from the cache and delete it! |
| */ |
| void deleteResource(GrResourceCacheEntry* entry); |