| Index: src/gpu/GrStencilAndCoverPathRenderer.cpp
|
| diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp
|
| index aed1743af22216864a2aa2382a2ea724cc0c82a9..99ed88dcf85c2c32606440d6b73294443cb59333 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(
|
| + kStencilBuffer_GrPipelineStage) &&
|
| + pipelineBuilder->canTweakAlphaForCoverage();
|
| + } 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,9 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(GrDrawTarget* target,
|
| }
|
|
|
| pipelineBuilder->stencil()->setDisabled();
|
| + if (antiAlias) {
|
| + SkASSERT(pipelineBuilder->getRenderTarget()->isMultisampled(kAnywhere_GrPipelineStage));
|
| + pipelineBuilder->enableState(GrPipelineBuilder::kHWAntialias_StateBit);
|
| + }
|
| return true;
|
| }
|
|
|