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
This commit is contained in:
csmartdalton 2016-06-08 09:32:54 -07:00 committed by Commit bot
parent 2f64bf7931
commit 7942f22c60
2 changed files with 4 additions and 3 deletions

View File

@ -972,8 +972,7 @@ bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
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);

View File

@ -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<GrPath> path(get_gr_path(fResourceProvider, *args.fPath, GrStyle::SimpleFill()));