Index: src/gpu/GrStencilAndCoverPathRenderer.cpp |
diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp |
index aed1743af22216864a2aa2382a2ea724cc0c82a9..10d248b6adbe4a311f1f9aefc794c1150d4bffe1 100644 |
--- a/src/gpu/GrStencilAndCoverPathRenderer.cpp |
+++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp |
@@ -58,9 +58,20 @@ bool GrStencilAndCoverPathRenderer::canDrawPath(const GrDrawTarget* target, |
const SkPath& path, |
const SkStrokeRec& stroke, |
bool antiAlias) const { |
- return !stroke.isHairlineStyle() && |
- !antiAlias && // doesn't do per-path AA, relies on the target having MSAA |
- pipelineBuilder->getStencil().isDisabled(); |
+ |
+ if (stroke.isHairlineStyle()) { |
+ return false; |
+ } |
+ if (!pipelineBuilder->getStencil().isDisabled()) { |
+ return false; |
+ } |
+ if (antiAlias) { |
+ return pipelineBuilder->getRenderTarget()->isMultisampled( |
+ GrRenderTarget::kStencilBuffer_PipelineStage) && |
+ pipelineBuilder->canTweakAlphaForCoverage(); |
Chris Dalton
2015/03/26 05:11:38
Here too -- may need to check if it will do in-sha
|
+ } else { |
+ return true; // doesn't do per-path AA, relies on the target having MSAA |
+ } |
} |
GrPathRenderer::StencilSupport |
@@ -101,7 +112,6 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(GrDrawTarget* target, |
const SkPath& path, |
const SkStrokeRec& stroke, |
bool antiAlias) { |
- SkASSERT(!antiAlias); |
SkASSERT(!stroke.isHairlineStyle()); |
SkASSERT(pipelineBuilder->getStencil().isDisabled()); |
@@ -160,5 +170,10 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(GrDrawTarget* target, |
} |
pipelineBuilder->stencil()->setDisabled(); |
+ if (antiAlias) { |
+ SkASSERT(pipelineBuilder->getRenderTarget()->isMultisampled( |
+ GrRenderTarget::kStencilBuffer_PipelineStage)); |
+ pipelineBuilder->enableState(GrPipelineBuilder::kHWAntialias_StateBit); |
+ } |
return true; |
} |