Add geometry domain for non-rectilinear quads

Bug: chromium:947055
Change-Id: Ic110a1c4e83af0a8efa47ebf2dd035dfdb0e7af0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204725
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/GrQuadPerEdgeAA.h b/src/gpu/ops/GrQuadPerEdgeAA.h
index 314253c..f031dbf 100644
--- a/src/gpu/ops/GrQuadPerEdgeAA.h
+++ b/src/gpu/ops/GrQuadPerEdgeAA.h
@@ -44,7 +44,9 @@
                 , fColorType(static_cast<unsigned>(colorType))
                 , fHasDomain(static_cast<unsigned>(domain))
                 , fUsesCoverageAA(aa == GrAAType::kCoverage)
-                , fCompatibleWithCoverageAsAlpha(coverageAsAlpha) { }
+                , fCompatibleWithCoverageAsAlpha(coverageAsAlpha)
+                , fRequiresGeometryDomain(aa == GrAAType::kCoverage &&
+                                          deviceQuadType > GrQuadType::kRectilinear) { }
 
         GrQuadType deviceQuadType() const { return static_cast<GrQuadType>(fDeviceQuadType); }
         GrQuadType localQuadType() const { return static_cast<GrQuadType>(fLocalQuadType); }
@@ -54,7 +56,7 @@
         bool hasDomain() const { return fHasDomain; }
         bool usesCoverageAA() const { return fUsesCoverageAA; }
         bool compatibleWithCoverageAsAlpha() const { return fCompatibleWithCoverageAsAlpha; }
-
+        bool requiresGeometryDomain() const { return fRequiresGeometryDomain; }
         // Will always be 2 or 3
         int deviceDimensionality() const;
         // Will always be 0 if hasLocalCoords is false, otherwise will be 2 or 3
@@ -72,6 +74,9 @@
         unsigned fHasDomain: 1;
         unsigned fUsesCoverageAA: 1;
         unsigned fCompatibleWithCoverageAsAlpha: 1;
+        // The geometry domain serves to clip off pixels touched by quads with sharp corners that
+        // would otherwise exceed the miter limit for the AA-outset geometry.
+        unsigned fRequiresGeometryDomain: 1;
     };
 
     sk_sp<GrGeometryProcessor> MakeProcessor(const VertexSpec& spec);