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 | |
8 | #ifndef GrCCClipProcessor_DEFINED |
9 | #define GrCCClipProcessor_DEFINED |
10 | |
11 | #include "src/gpu/GrFragmentProcessor.h" |
12 | |
13 | class GrCCClipPath; |
14 | |
15 | class GrCCClipProcessor : public GrFragmentProcessor { |
16 | public: |
17 | enum class IsCoverageCount : bool { |
18 | kNo = false, |
19 | kYes = true |
20 | }; |
21 | |
22 | enum class MustCheckBounds : bool { |
23 | kNo = false, |
24 | kYes = true |
25 | }; |
26 | |
27 | GrCCClipProcessor(std::unique_ptr<GrFragmentProcessor>, const GrCaps&, const GrCCClipPath*, |
28 | IsCoverageCount, MustCheckBounds); |
29 | |
30 | const char* name() const override { return "GrCCClipProcessor"; } |
31 | std::unique_ptr<GrFragmentProcessor> clone() const override; |
32 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
33 | bool onIsEqual(const GrFragmentProcessor&) const override; |
34 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
35 | |
36 | private: |
37 | explicit GrCCClipProcessor(const GrCCClipProcessor&); |
38 | |
39 | const GrCCClipPath* const fClipPath; |
40 | const bool fIsCoverageCount; |
41 | const bool fMustCheckBounds; |
42 | |
43 | class Impl; |
44 | |
45 | typedef GrFragmentProcessor INHERITED; |
46 | }; |
47 | |
48 | #endif |
49 |