Fix instances where hwaa was wrong for mixed samples
Fixes a bug with coverage-AA hairlines where hwaa was unintentionally
enabled for mixed samples, and a bug with path stenciling where hwaa
was unintentionally disabled for mixed samples.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2043203004
Review-Url: https://codereview.chromium.org/2043203004
diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
index 750c1f1..2faf1af 100644
--- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
@@ -972,8 +972,7 @@
SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fViewMatrix, *args.fPath,
*args.fStyle, devClipBounds));
- GrPipelineBuilder pipelineBuilder(*args.fPaint,
- args.fDrawContext->isStencilBufferMultisampled());
+ GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->isUnifiedMultisampled());
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch);
diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
index 296343d..1e6675a 100644
--- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
@@ -69,12 +69,14 @@
void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) {
GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(),
"GrStencilAndCoverPathRenderer::onStencilPath");
+ SkASSERT(!args.fIsAA || args.fDrawContext->isStencilBufferMultisampled());
GrPaint paint;
SkSafeUnref(paint.setXPFactory(GrDisableColorXPFactory::Create()));
paint.setAntiAlias(args.fIsAA);
- const GrPipelineBuilder pipelineBuilder(paint, args.fDrawContext->isUnifiedMultisampled());
+ GrPipelineBuilder pipelineBuilder(paint, args.fDrawContext->isUnifiedMultisampled());
+ pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, args.fIsAA);
SkASSERT(!args.fPath->isInverseFillType());
SkAutoTUnref<GrPath> path(get_gr_path(fResourceProvider, *args.fPath, GrStyle::SimpleFill()));