Chromium Code Reviews| 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); |
| } |