ccpr: Add an MSAA atlas mode

Adds the option to use a multisampled (or mixed sampled) atlas, and
uses the sample mask and stencil buffer instead of coverage counts.

Bug: skia:
Change-Id: I9fb76d17895ae25208124f6c27e37977ac31b5eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227428
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index f41f0f1..c05b30b 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
@@ -133,8 +133,8 @@
         // executing the same code. A per-pixel branch makes this pre-condition impossible to
         // fulfill.
         SkASSERT(!(ScopeFlags::kInsidePerPixelBranch & scopeFlags));
-        this->codeAppendf("float2 grad = float2(dFdx(fn), dFdy(fn));");
-        this->codeAppendf("float fnwidth = fwidth(fn);");
+        this->codeAppendf("float2 grad = float2(dFdx(%s), dFdy(%s));", fn, fn);
+        this->codeAppendf("float fnwidth = fwidth(%s);", fn);
         grad = "grad";
     } else {
         this->codeAppendf("float fnwidth = abs(%s.x) + abs(%s.y);", grad, grad);