Add analytic clip FPs that read from the CCPR atlas
Bug: skia:7190
Change-Id: Ie31d368f52910e6917efdeb1b024370b06fc11ee
Reviewed-on: https://skia-review.googlesource.com/77160
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/ccpr/GrCCPRClipProcessor.h b/src/gpu/ccpr/GrCCPRClipProcessor.h
new file mode 100644
index 0000000..c6f4d94
--- /dev/null
+++ b/src/gpu/ccpr/GrCCPRClipProcessor.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrCCPRClipProcessor_DEFINED
+#define GrCCPRClipProcessor_DEFINED
+
+#include "GrFragmentProcessor.h"
+#include "ccpr/GrCoverageCountingPathRenderer.h"
+
+class GrCCPRClipProcessor : public GrFragmentProcessor {
+public:
+ using ClipPath = GrCoverageCountingPathRenderer::ClipPath;
+
+ enum class MustCheckBounds : bool {
+ kNo = false,
+ kYes = true
+ };
+
+ GrCCPRClipProcessor(const ClipPath*, MustCheckBounds, SkPath::FillType overrideFillType);
+
+ const char* name() const override { return "GrCCPRClipProcessor"; }
+ std::unique_ptr<GrFragmentProcessor> clone() const override;
+ void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
+ bool onIsEqual(const GrFragmentProcessor&) const override;
+ GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+
+private:
+ const ClipPath* const fClipPath;
+ const bool fMustCheckBounds;
+ const SkPath::FillType fOverrideFillType;
+ const TextureSampler fAtlasAccess;
+
+ class Impl;
+
+ typedef GrFragmentProcessor INHERITED;
+};
+
+#endif