| Index: src/gpu/GrDrawingManager.cpp
|
| diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
|
| index a063c398edba419de83e0a8eb043cca814d57d25..ca50fe45024e3c26f96d9b4e4209ea64c56552ea 100644
|
| --- a/src/gpu/GrDrawingManager.cpp
|
| +++ b/src/gpu/GrDrawingManager.cpp
|
| @@ -8,6 +8,7 @@
|
| #include "GrDrawContext.h"
|
| #include "GrDrawingManager.h"
|
| #include "GrDrawTarget.h"
|
| +#include "GrPathRenderingDrawContext.h"
|
| #include "GrResourceProvider.h"
|
| #include "GrSoftwarePathRenderer.h"
|
| #include "SkTTopoSort.h"
|
| @@ -28,12 +29,6 @@ void GrDrawingManager::cleanup() {
|
|
|
| fDrawTargets.reset();
|
|
|
| - delete fNVPRTextContext;
|
| - fNVPRTextContext = nullptr;
|
| -
|
| - delete fAtlasTextContext;
|
| - fAtlasTextContext = nullptr;
|
| -
|
| delete fPathRendererChain;
|
| fPathRendererChain = nullptr;
|
| SkSafeSetNull(fSoftwarePathRenderer);
|
| @@ -114,32 +109,6 @@ void GrDrawingManager::flush() {
|
| fFlushing = false;
|
| }
|
|
|
| -GrTextContext* GrDrawingManager::textContext(const SkSurfaceProps& props, GrRenderTarget* rt) {
|
| - if (this->abandoned()) {
|
| - return nullptr;
|
| - }
|
| -
|
| - bool useDIF = props.isUseDeviceIndependentFonts();
|
| -
|
| - if (useDIF && fContext->caps()->shaderCaps()->pathRenderingSupport() &&
|
| - rt->isStencilBufferMultisampled()) {
|
| - GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAttachment(rt);
|
| - if (sb) {
|
| - if (!fNVPRTextContext) {
|
| - fNVPRTextContext = GrStencilAndCoverTextContext::Create();
|
| - }
|
| -
|
| - return fNVPRTextContext;
|
| - }
|
| - }
|
| -
|
| - if (!fAtlasTextContext) {
|
| - fAtlasTextContext = GrAtlasTextContext::Create();
|
| - }
|
| -
|
| - return fAtlasTextContext;
|
| -}
|
| -
|
| GrDrawTarget* GrDrawingManager::newDrawTarget(GrRenderTarget* rt) {
|
| SkASSERT(fContext);
|
|
|
| @@ -196,6 +165,21 @@ GrDrawContext* GrDrawingManager::drawContext(GrRenderTarget* rt,
|
| return nullptr;
|
| }
|
|
|
| +
|
| + bool useDIF = false;
|
| + if (surfaceProps) {
|
| + useDIF = surfaceProps->isUseDeviceIndependentFonts();
|
| + }
|
| +
|
| + if (useDIF && fContext->caps()->shaderCaps()->pathRenderingSupport() &&
|
| + rt->isStencilBufferMultisampled()) {
|
| + GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAttachment(rt);
|
| + if (sb) {
|
| + return new GrPathRenderingDrawContext(fContext, this, rt, surfaceProps,
|
| + fContext->getAuditTrail(), fSingleOwner);
|
| + }
|
| + }
|
| +
|
| return new GrDrawContext(fContext, this, rt, surfaceProps, fContext->getAuditTrail(),
|
| fSingleOwner);
|
| }
|
|
|