Revert "Remove all instances of incorrect coverage with DMSAA"
This reverts commit 3722d3195be5ddba7f3d44095565628dbe65452b.
Reason for revert: Disables msaa for paths
Original change's description:
> Remove all instances of incorrect coverage with DMSAA
>
> Here we pivot and handle DMSAA differently depending on platform:
>
> 1) Desktop GL and EXT_multisample_compatibility: Here it's easy to use
> all our existing coverage ops because we can just call
> glDisable(GL_MULTISAMPLE). So we only trigger MSAA for paths and
> use the coverage ops for everything else with MSAA disabled.
>
> 2) EXT_multisampled_render_to_to_texture (86% adoption on Android):
> The assumption here is that MSAA is almost free. So we just allow
> MSAA to be triggered often and don't worry about it.
>
> Devices that neither support #1 nor #2 just don't get DMSAA for now.
>
> Bug: skia:11396
> Change-Id: I53ad840216ea6d88ae69eece6f7a062f9e82dad7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421019
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com
Change-Id: If9b9cd25b93d5db2cc7f9c6cd4be783284587a37
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11396
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421416
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/ops/GrDashLinePathRenderer.cpp b/src/gpu/ops/GrDashLinePathRenderer.cpp
index eda3392..dfa2967 100644
--- a/src/gpu/ops/GrDashLinePathRenderer.cpp
+++ b/src/gpu/ops/GrDashLinePathRenderer.cpp
@@ -37,9 +37,15 @@
aaMode = GrDashOp::AAMode::kNone;
break;
case GrAAType::kMSAA:
- // In this mode we will use aa between dashes but the outer border uses MSAA. Otherwise,
- // we can wind up with external edges antialiased and internal edges unantialiased.
- aaMode = GrDashOp::AAMode::kCoverageWithMSAA;
+ if (args.fSurfaceDrawContext->canUseDynamicMSAA()) {
+ // In DMSAA we avoid using MSAA, in order to reduce the number of MSAA triggers.
+ aaMode = GrDashOp::AAMode::kCoverage;
+ } else {
+ // In this mode we will use aa between dashes but the outer border uses MSAA.
+ // Otherwise, we can wind up with external edges antialiased and internal edges
+ // unantialiased.
+ aaMode = GrDashOp::AAMode::kCoverageWithMSAA;
+ }
break;
case GrAAType::kCoverage:
aaMode = GrDashOp::AAMode::kCoverage;