| 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
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|