Revert "Reland "Remove antialiasing control from GrPaint.""

This reverts commit 3944484020d98ff8f386378296106c321279482b.

Reason for revert: Merges badly with a recent change. Will rebase and reland.

Original change's description:
> Reland "Remove antialiasing control from GrPaint."
> 
> This contains fixes for GLPrograms test and mixed samples rendering.
> 
> This reverts commit 419d81eed4a010e6080db199795117cbedf9e6e4.
> 
> BUG=skia:
> 
> Change-Id: If8f002fbfaaaab6d1607403f2b15ccc7f1e17e87
> Reviewed-on: https://skia-review.googlesource.com/5763
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org
BUG=skia:
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Iff9657041e28604a845bc5a9acec7c9b248c53bd
Reviewed-on: https://skia-review.googlesource.com/5772
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/batches/GrDashLinePathRenderer.cpp b/src/gpu/batches/GrDashLinePathRenderer.cpp
index 9304885..d2a420d 100644
--- a/src/gpu/batches/GrDashLinePathRenderer.cpp
+++ b/src/gpu/batches/GrDashLinePathRenderer.cpp
@@ -16,9 +16,6 @@
     SkPoint pts[2];
     bool inverted;
     if (args.fShape->style().isDashed() && args.fShape->asLine(pts, &inverted)) {
-        if (args.fAAType == GrAAType::kMixedSamples) {
-            return false;
-        }
         // We should never have an inverse dashed case.
         SkASSERT(!inverted);
         return GrDashingEffect::CanDrawDashLine(pts, args.fShape->style(), *args.fViewMatrix);
@@ -29,19 +26,16 @@
 bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
     GR_AUDIT_TRAIL_AUTO_FRAME(args.fRenderTargetContext->auditTrail(),
                               "GrDashLinePathRenderer::onDrawPath");
-    GrDashingEffect::AAMode aaMode = GrDashingEffect::AAMode::kNone;
-    switch (args.fAAType) {
-        case GrAAType::kNone:
-            break;
-        case GrAAType::kCoverage:
-        case GrAAType::kMixedSamples:
-            aaMode = GrDashingEffect::AAMode::kCoverage;
-            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 = GrDashingEffect::AAMode::kCoverageWithMSAA;
-            break;
+    bool useHWAA = args.fRenderTargetContext->isUnifiedMultisampled();
+    GrDashingEffect::AAMode aaMode;
+    if (useHWAA) {
+        // 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.
+        aaMode = GrDashingEffect::AAMode::kCoverageWithMSAA;
+    } else if (args.fAntiAlias) {
+        aaMode = GrDashingEffect::AAMode::kCoverage;
+    } else {
+        aaMode = GrDashingEffect::AAMode::kNone;
     }
     SkPoint pts[2];
     SkAssertResult(args.fShape->asLine(pts, nullptr));
@@ -54,7 +48,7 @@
         return false;
     }
 
-    GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fAAType);
+    GrPipelineBuilder pipelineBuilder(*args.fPaint, useHWAA);
     pipelineBuilder.setUserStencil(args.fUserStencilSettings);
 
     args.fRenderTargetContext->addDrawOp(pipelineBuilder, *args.fClip, batch.get());