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

Unified Diff: src/gpu/GrResourceCache.h

Issue 19591003: Add purgeAsNeeded calls before addResource calls (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: added extraCount & extraSize to account for future memory requirements 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 10123)
+++ src/gpu/GrResourceCache.h (working copy)
@@ -326,8 +326,12 @@
* Allow cache to purge unused resources to obey resource limitations
* Note: this entry point will be hidden (again) once totally ref-driven
* cache maintenance is implemented
+ *
+ * extraCount and extraBytes are added to the current resource allocation
+ * to make sure enough room is available for future additions (e.g,
+ * 10MB across 10 textures is about to be added).
*/
- void purgeAsNeeded();
+ void purgeAsNeeded(int extraCount = 0, size_t extraBytes = 0);
#if GR_DEBUG
void validate() const;
@@ -384,7 +388,7 @@
PFOverbudgetCB fOverbudgetCB;
void* fOverbudgetData;
- void internalPurge();
+ void internalPurge(int extraCount, size_t extraBytes);
#if GR_DEBUG
static size_t countBytes(const SkTInternalLList<GrResourceEntry>& list);
« 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