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/ccpr/GrSampleMaskProcessor.h b/src/gpu/ccpr/GrSampleMaskProcessor.h
new file mode 100644
index 0000000..3fdd96f
--- /dev/null
+++ b/src/gpu/ccpr/GrSampleMaskProcessor.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2019 Google LLC.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrSampleMaskProcessor_DEFINED
+#define GrSampleMaskProcessor_DEFINED
+
+#include "src/gpu/ccpr/GrCCCoverageProcessor.h"
+
+/**
+ * This class implements GrCCCoverageProcessor with MSAA using the sample mask.
+ */
+class GrSampleMaskProcessor : public GrCCCoverageProcessor {
+public:
+    GrSampleMaskProcessor() : GrCCCoverageProcessor(kGrSampleMaskProcessor_ClassID) {}
+
+private:
+    void reset(PrimitiveType, GrResourceProvider*) override;
+
+    void appendMesh(sk_sp<const GrGpuBuffer> instanceBuffer, int instanceCount, int baseInstance,
+                    SkTArray<GrMesh>* out) const override;
+
+    GrGLSLPrimitiveProcessor* onCreateGLSLInstance(std::unique_ptr<Shader>) const override;
+
+    SkSTArray<2, Attribute> fInputAttribs;
+
+    class Impl;
+};
+
+#endif