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

Unified Diff: src/gpu/GrContext.cpp

Issue 1071333002: Added ability to flush context to GrTextBlobCache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix cache budget Created 5 years, 8 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
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 2d61f35a4f02151bfc5508513ffb52c89e8c96b4..6e2b73a57ff96b51ecfa4220dab17850ea762a68 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -137,7 +137,7 @@ void GrContext::initCommon() {
// GrBatchFontCache will eventually replace GrFontCache
fBatchFontCache = SkNEW_ARGS(GrBatchFontCache, (this));
- fTextBlobCache.reset(SkNEW(GrTextBlobCache));
+ fTextBlobCache.reset(SkNEW_ARGS(GrTextBlobCache, (TextBlobCacheOverBudgetCB, this)));
}
GrContext::~GrContext() {
@@ -354,6 +354,13 @@ void GrContext::OverBudgetCB(void* data) {
context->fFlushToReduceCacheSize = true;
}
+void GrContext::TextBlobCacheOverBudgetCB(void* data) {
+ SkASSERT(data);
+
+ GrContext* context = reinterpret_cast<GrContext*>(data);
robertphillips 2015/04/10 12:22:46 // Words here about why just flushing rather than
+ context->flush();
+}
+
int GrContext::getMaxTextureSize() const {
return SkTMin(fGpu->caps()->maxTextureSize(), fMaxTextureSizeOverride);
}
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrTextBlobCache.h » ('j') | src/gpu/GrTextBlobCache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698