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

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: fix for segfault 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
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 4c7f3eabe0e77116974e10160408ed7cb4c94dc8..a1f1c253a7ce45c5c4f2918891a412d9797e371c 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -10,7 +10,9 @@
#include "GrAARectRenderer.h"
#include "GrBatch.h"
+#include "GrBatchFontCache.h"
#include "GrBatchTarget.h"
+#include "GrBitmapTextContext.h"
#include "GrBufferAllocPool.h"
#include "GrDefaultGeoProcFactory.h"
#include "GrFontCache.h"
@@ -94,6 +96,7 @@ GrContext::GrContext(const Options& opts) : fOptions(opts) {
fPathRendererChain = NULL;
fSoftwarePathRenderer = NULL;
fResourceCache = NULL;
+ fBatchFontCache = NULL;
fFontCache = NULL;
fDrawBuffer = NULL;
fDrawBufferVBAllocPool = NULL;
@@ -129,6 +132,10 @@ void GrContext::initCommon() {
fDidTestPMConversions = false;
this->setupDrawBuffer();
+
+ // GrBatchFontCache will eventually replace GrFontCache
+ fBatchFontCache = SkNEW(GrBatchFontCache);
+ fBatchFontCache->init(this);
}
GrContext::~GrContext() {
@@ -143,6 +150,7 @@ GrContext::~GrContext() {
}
SkDELETE(fResourceCache);
+ SkDELETE(fBatchFontCache);
SkDELETE(fFontCache);
SkDELETE(fDrawBuffer);
SkDELETE(fDrawBufferVBAllocPool);
@@ -180,6 +188,7 @@ void GrContext::abandonContext() {
fAARectRenderer->reset();
fOvalRenderer->reset();
+ fBatchFontCache->freeAll();
fFontCache->freeAll();
fLayerCache->freeAll();
}
@@ -198,6 +207,7 @@ void GrContext::freeGpuResources() {
fAARectRenderer->reset();
fOvalRenderer->reset();
+ fBatchFontCache->freeAll();
fFontCache->freeAll();
fLayerCache->freeAll();
// a path renderer may be holding onto resources
@@ -226,8 +236,12 @@ GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget,
}
}
+#ifdef USE_BITMAP_TEXTBLOBS
+ return GrBitmapTextContextB::Create(this, gpuDevice, leakyProperties);
+#else
return GrDistanceFieldTextContext::Create(this, gpuDevice, leakyProperties,
enableDistanceFieldFonts);
+#endif
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698