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

Unified Diff: src/gpu/GrResourceCache.h

Issue 18466005: Allow the resource cache to (indirectly) flush the InOrderDrawBuffer (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: fixed comment Created 7 years, 5 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 | « src/gpu/GrContext.cpp ('k') | src/gpu/GrResourceCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceCache.h
===================================================================
--- src/gpu/GrResourceCache.h (revision 9928)
+++ src/gpu/GrResourceCache.h (working copy)
@@ -238,6 +238,17 @@
void setLimits(int maxResource, size_t maxResourceBytes);
/**
+ * Set the callback the cache should use when it is still over budget
+ * after a purge. The 'data' provided here will be passed back to the
+ * callback.
bsalomon 2013/07/09 17:43:25 Maybe mention that the cache will attempt to purge
robertphillips 2013/07/10 10:15:13 Done. I expanded the comment and made the CB now
+ */
+ typedef void (*PFOverbudgetCB)(void* data);
+ void setOverbudgetCallback(PFOverbudgetCB overbudgetCB, void* data) {
+ fOverbudgetCB = overbudgetCB;
+ fOverbudgetData = data;
+ }
+
+ /**
* Returns the number of bytes consumed by cached resources.
*/
size_t getCachedResourceBytes() const { return fEntryBytes; }
@@ -360,8 +371,13 @@
size_t fClientDetachedBytes;
// prevents recursive purging
- bool fPurging;
+ bool fPurging;
+ PFOverbudgetCB fOverbudgetCB;
+ void* fOverbudgetData;
+
+ void internalPurge();
+
#if GR_DEBUG
static size_t countBytes(const SkTInternalLList<GrResourceEntry>& list);
#endif
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrResourceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698