aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rwxr-xr-x[-rw-r--r--]src/gpu/GrContext.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 6c90c178d3..d59d2e8d40 100644..100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -16,6 +16,7 @@
#include "GrAARectRenderer.h"
#include "GrBufferAllocPool.h"
#include "GrGpu.h"
+#include "GrDistanceFieldTextContext.h"
#include "GrDrawTargetCaps.h"
#include "GrIndexBuffer.h"
#include "GrInOrderDrawBuffer.h"
@@ -26,6 +27,7 @@
#include "GrResourceCache.h"
#include "GrSoftwarePathRenderer.h"
#include "GrStencilBuffer.h"
+#include "GrStencilAndCoverTextContext.h"
#include "GrStrokeInfo.h"
#include "GrTextStrike.h"
#include "GrTraceMarker.h"
@@ -236,6 +238,19 @@ void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes)
}
}
+GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget,
+ const SkDeviceProperties&
+ leakyProperties,
+ bool enableDistanceFieldFonts) {
+ if (fGpu->caps()->pathRenderingSupport()) {
+ if (renderTarget->getStencilBuffer() && renderTarget->isMultisampled()) {
+ return SkNEW_ARGS(GrStencilAndCoverTextContext, (this, leakyProperties));
+ }
+ }
+ return SkNEW_ARGS(GrDistanceFieldTextContext, (this, leakyProperties,
+ enableDistanceFieldFonts));
+}
+
////////////////////////////////////////////////////////////////////////////////
GrTexture* GrContext::findAndRefTexture(const GrTextureDesc& desc,