Index: src/gpu/GrStencilAndCoverPathRenderer.cpp |
diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp |
index aed1743af22216864a2aa2382a2ea724cc0c82a9..d1507ed6e552500613d13c21ae4dd21e5ad192f0 100644 |
--- a/src/gpu/GrStencilAndCoverPathRenderer.cpp |
+++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp |
@@ -58,9 +58,30 @@ 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) { |
+ // No Xfer processors that might do blending inside the shader. |
+ // Coverage modulation for mixed samples is done *after* shading, so blending |
+ // must occur in the ROP. |
+ // TODO: Update Xfer processors to better support mixed samples. |
+ if (GrRenderTarget::kStencil_SampleConfig == |
+ pipelineBuilder->getRenderTarget()->sampleConfig() && |
+ pipelineBuilder->willXPNeedDstCopy(*fGpu->caps(), GrProcOptInfo(), GrProcOptInfo())) { |
+ return false; |
+ } |
+ |
+ return pipelineBuilder->getRenderTarget()->isMultisampled( |
+ GrRenderTarget::kStencil_BufferBit) && |
+ pipelineBuilder->canTweakAlphaForCoverage(); |
+ } else { |
+ return true; // doesn't do per-path AA, relies on the target having MSAA |
+ } |
} |
GrPathRenderer::StencilSupport |
@@ -101,7 +122,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 +180,10 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(GrDrawTarget* target, |
} |
pipelineBuilder->stencil()->setDisabled(); |
+ if (antiAlias) { |
+ SkASSERT(pipelineBuilder->getRenderTarget()->isMultisampled( |
+ GrRenderTarget::kStencil_BufferBit)); |
+ pipelineBuilder->enableState(GrPipelineBuilder::kHWAntialias_StateBit); |
Chris Dalton
2015/04/17 22:05:12
Sorry, I think I may have misled you about where t
|
+ } |
return true; |
} |