Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame^] | 8 | #ifndef GrCCClipProcessor_DEFINED |
| 9 | #define GrCCClipProcessor_DEFINED |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 10 | |
| 11 | #include "GrFragmentProcessor.h" |
| 12 | #include "ccpr/GrCoverageCountingPathRenderer.h" |
| 13 | |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame^] | 14 | class GrCCClipProcessor : public GrFragmentProcessor { |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 15 | public: |
| 16 | using ClipPath = GrCoverageCountingPathRenderer::ClipPath; |
| 17 | |
| 18 | enum class MustCheckBounds : bool { |
| 19 | kNo = false, |
| 20 | kYes = true |
| 21 | }; |
| 22 | |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame^] | 23 | GrCCClipProcessor(const ClipPath*, MustCheckBounds, SkPath::FillType overrideFillType); |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 24 | |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame^] | 25 | const char* name() const override { return "GrCCClipProcessor"; } |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 26 | std::unique_ptr<GrFragmentProcessor> clone() const override; |
| 27 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
| 28 | bool onIsEqual(const GrFragmentProcessor&) const override; |
| 29 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
| 30 | |
| 31 | private: |
| 32 | const ClipPath* const fClipPath; |
| 33 | const bool fMustCheckBounds; |
| 34 | const SkPath::FillType fOverrideFillType; |
| 35 | const TextureSampler fAtlasAccess; |
| 36 | |
| 37 | class Impl; |
| 38 | |
| 39 | typedef GrFragmentProcessor INHERITED; |
| 40 | }; |
| 41 | |
| 42 | #endif |