Chromium Code Reviews| Index: src/gpu/GrStencilAndCoverPathRenderer.cpp |
| diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp |
| index aed1743af22216864a2aa2382a2ea724cc0c82a9..54b646c747b5b9f314a40798c9cf50172b15d57b 100644 |
| --- a/src/gpu/GrStencilAndCoverPathRenderer.cpp |
| +++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp |
| @@ -59,7 +59,8 @@ bool GrStencilAndCoverPathRenderer::canDrawPath(const GrDrawTarget* target, |
| const SkStrokeRec& stroke, |
| bool antiAlias) const { |
| return !stroke.isHairlineStyle() && |
| - !antiAlias && // doesn't do per-path AA, relies on the target having MSAA |
| + (!antiAlias || // doesn't do per-path AA, relies on the target having MSAA |
| + pipelineBuilder->getRenderTarget()->isMultisampled(kStencil_GrSampleConfig)) && |
| pipelineBuilder->getStencil().isDisabled(); |
|
Chris Dalton
2015/03/17 00:39:35
Here we can punt and only use nvfms if coverage mo
|
| } |
| @@ -101,7 +102,8 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(GrDrawTarget* target, |
| const SkPath& path, |
| const SkStrokeRec& stroke, |
| bool antiAlias) { |
| - SkASSERT(!antiAlias); |
| + SkASSERT(!antiAlias || |
| + pipelineBuilder->getRenderTarget()->isMultisampled(kStencil_GrSampleConfig)); |
|
Chris Dalton
2015/03/16 19:31:24
We can take out this assert from here since we do
|
| SkASSERT(!stroke.isHairlineStyle()); |
| SkASSERT(pipelineBuilder->getStencil().isDisabled()); |
| @@ -160,5 +162,9 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(GrDrawTarget* target, |
| } |
| pipelineBuilder->stencil()->setDisabled(); |
| + if (antiAlias) { |
| + SkASSERT(pipelineBuilder->getRenderTarget()->isMultisampled(kStencil_GrSampleConfig)); |
| + pipelineBuilder->enableState(GrPipelineBuilder::kHWAntialias_StateBit); |
| + } |
| return true; |
| } |