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/GrContext.cpp

Issue 1011403004: BitmapTextBatch and BitmapTextBlob (Closed) Base URL: https://skia.googlesource.com/skia.git@dfpr_take_2
Patch Set: tweak Created 5 years, 9 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 35b34e392d4bed5a9124a5cebbe3ffaf1ca1a919..b1500dc8df9d21b3ce64e621be313d1d498423e6 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -10,6 +10,7 @@
#include "GrAARectRenderer.h"
#include "GrBatch.h"
+#include "GrBatchFontCache.h"
#include "GrBatchTarget.h"
#include "GrBufferAllocPool.h"
#include "GrDefaultGeoProcFactory.h"
@@ -94,6 +95,7 @@ GrContext::GrContext(const Options& opts) : fOptions(opts) {
fPathRendererChain = NULL;
fSoftwarePathRenderer = NULL;
fResourceCache = NULL;
+ fBatchFontCache = NULL;
fFontCache = NULL;
fDrawBuffer = NULL;
fDrawBufferVBAllocPool = NULL;
@@ -129,6 +131,9 @@ void GrContext::initCommon() {
fDidTestPMConversions = false;
this->setupDrawBuffer();
+
+ // GrBatchFontCache creates resources on context in its constructor
+ fBatchFontCache = SkNEW_ARGS(GrBatchFontCache, (this));
}
GrContext::~GrContext() {
@@ -143,6 +148,7 @@ GrContext::~GrContext() {
}
SkDELETE(fResourceCache);
+ SkDELETE(fBatchFontCache);
SkDELETE(fFontCache);
SkDELETE(fDrawBuffer);
SkDELETE(fDrawBufferVBAllocPool);
@@ -180,6 +186,7 @@ void GrContext::abandonContext() {
fAARectRenderer->reset();
fOvalRenderer->reset();
+ fBatchFontCache->freeAll();
fFontCache->freeAll();
fLayerCache->freeAll();
}
@@ -198,6 +205,7 @@ void GrContext::freeGpuResources() {
fAARectRenderer->reset();
fOvalRenderer->reset();
+ fBatchFontCache->freeAll();
fFontCache->freeAll();
fLayerCache->freeAll();
// a path renderer may be holding onto resources

Powered by Google App Engine
This is Rietveld 408576698