ccpr: Calculate edge coverage in the coverage processor

Does the opposite-edge coverage calculation for curves in the coverage
processor, rather than the Shader class. This allows the vertex shader
implementation to do it more clean and directly, as well as allowing
the future sample mask implementation to disregard edge coverage
entirely.

Bug: skia:
Change-Id: Idaddfff8b22e3223f2a4e286900941969f975c6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208990
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/ccpr/GrCCCoverageProcessor.cpp b/src/gpu/ccpr/GrCCCoverageProcessor.cpp
index 0be4c08..06d2003 100644
--- a/src/gpu/ccpr/GrCCCoverageProcessor.cpp
+++ b/src/gpu/ccpr/GrCCCoverageProcessor.cpp
@@ -18,9 +18,10 @@
 #include "glsl/GrGLSLVertexGeoBuilder.h"
 
 class GrCCCoverageProcessor::TriangleShader : public GrCCCoverageProcessor::Shader {
-    void onEmitVaryings(GrGLSLVaryingHandler* varyingHandler, GrGLSLVarying::Scope scope,
-                        SkString* code, const char* position, const char* coverage,
-                        const char* cornerCoverage) override {
+    void onEmitVaryings(
+            GrGLSLVaryingHandler* varyingHandler, GrGLSLVarying::Scope scope, SkString* code,
+            const char* position, const char* coverage, const char* cornerCoverage,
+            const char* /*wind*/) override {
         if (!cornerCoverage) {
             fCoverages.reset(kHalf_GrSLType, scope);
             varyingHandler->addVarying("coverage", &fCoverages);
@@ -75,19 +76,6 @@
     }
 }
 
-void GrCCCoverageProcessor::Shader::EmitEdgeDistanceEquation(GrGLSLVertexGeoBuilder* s,
-                                                             const char* leftPt,
-                                                             const char* rightPt,
-                                                             const char* outputDistanceEquation) {
-    s->codeAppendf("float2 n = float2(%s.y - %s.y, %s.x - %s.x);",
-                   rightPt, leftPt, leftPt, rightPt);
-    s->codeAppend ("float nwidth = (abs(n.x) + abs(n.y)) * (bloat * 2);");
-    // When nwidth=0, wind must also be 0 (and coverage * wind = 0). So it doesn't matter what we
-    // come up with here as long as it isn't NaN or Inf.
-    s->codeAppend ("n /= (0 != nwidth) ? nwidth : 1;");
-    s->codeAppendf("%s = float3(-n, dot(n, %s) - .5);", outputDistanceEquation, leftPt);
-}
-
 void GrCCCoverageProcessor::Shader::CalcEdgeCoverageAtBloatVertex(GrGLSLVertexGeoBuilder* s,
                                                                   const char* leftPt,
                                                                   const char* rightPt,