From 7942f22c607caf826a6a609b89338a569d0a30e7 Mon Sep 17 00:00:00 2001 From: csmartdalton Date: Wed, 8 Jun 2016 09:32:54 -0700 Subject: [PATCH] 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 --- src/gpu/batches/GrAAHairLinePathRenderer.cpp | 3 +-- src/gpu/batches/GrStencilAndCoverPathRenderer.cpp | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp index 750c1f1304..2faf1afa14 100644 --- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp @@ -972,8 +972,7 @@ bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) { SkAutoTUnref 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 296343da7a..1e6675a9a1 100644 --- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp +++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp @@ -69,12 +69,14 @@ static GrPath* get_gr_path(GrResourceProvider* resourceProvider, const SkPath& s 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 path(get_gr_path(fResourceProvider, *args.fPath, GrStyle::SimpleFill()));