| Index: src/gpu/batches/GrDashLinePathRenderer.cpp
|
| diff --git a/src/gpu/batches/GrDashLinePathRenderer.cpp b/src/gpu/batches/GrDashLinePathRenderer.cpp
|
| index 51ef0528aa1634cf72e9820da25bf0a9e7b65904..d75ca38b7d02562ca40860b19697e753e35d45fd 100644
|
| --- a/src/gpu/batches/GrDashLinePathRenderer.cpp
|
| +++ b/src/gpu/batches/GrDashLinePathRenderer.cpp
|
| @@ -22,11 +22,15 @@ bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
|
| bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
|
| GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(),
|
| "GrDashLinePathRenderer::onDrawPath");
|
| - bool msaaIsEnabled = args.fDrawContext->isUnifiedMultisampled();
|
| + // We always take the msaa codepath, regardless of paint aa, if the platform won't be able to
|
| + // disable multisampling. Dashes use a mix of msaa and coverage aa, so if we took the bw path in
|
| + // this case we would wind up with external edges antialiased and internal edges unantialiased.
|
| + bool useHWAA = args.fDrawContext->isUnifiedMultisampled() &&
|
| + (!args.fDrawContext->caps()->multisampleDisableSupport() ||
|
| + args.fPaint->isAntiAlias());
|
| +
|
| GrDashingEffect::AAMode aaMode;
|
| - if (msaaIsEnabled) {
|
| - // We ignore args.fAntiAlias here and force anti aliasing when using MSAA. Otherwise,
|
| - // we can wind up with external edges antialiased and internal edges unantialiased.
|
| + if (useHWAA) {
|
| aaMode = GrDashingEffect::AAMode::kCoverageWithMSAA;
|
| } else if (args.fAntiAlias) {
|
| aaMode = GrDashingEffect::AAMode::kCoverage;
|
| @@ -44,7 +48,8 @@ bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
|
| return false;
|
| }
|
|
|
| - GrPipelineBuilder pipelineBuilder(*args.fPaint, msaaIsEnabled);
|
| + GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->isUnifiedMultisampled());
|
| + pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, useHWAA);
|
| pipelineBuilder.setUserStencil(args.fUserStencilSettings);
|
|
|
| args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch);
|
|
|