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