1 | /* |
2 | * Copyright 2018 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 | /************************************************************************************************** |
9 | *** This file was autogenerated from GrAlphaThresholdFragmentProcessor.fp; do not modify. |
10 | **************************************************************************************************/ |
11 | #ifndef GrAlphaThresholdFragmentProcessor_DEFINED |
12 | #define GrAlphaThresholdFragmentProcessor_DEFINED |
13 | |
14 | #include "include/core/SkM44.h" |
15 | #include "include/core/SkTypes.h" |
16 | |
17 | #include "src/gpu/GrFragmentProcessor.h" |
18 | |
19 | class GrAlphaThresholdFragmentProcessor : public GrFragmentProcessor { |
20 | public: |
21 | static std::unique_ptr<GrFragmentProcessor> Make(std::unique_ptr<GrFragmentProcessor> inputFP, |
22 | std::unique_ptr<GrFragmentProcessor> maskFP, |
23 | float innerThreshold, |
24 | float outerThreshold) { |
25 | return std::unique_ptr<GrFragmentProcessor>(new GrAlphaThresholdFragmentProcessor( |
26 | std::move(inputFP), std::move(maskFP), innerThreshold, outerThreshold)); |
27 | } |
28 | GrAlphaThresholdFragmentProcessor(const GrAlphaThresholdFragmentProcessor& src); |
29 | std::unique_ptr<GrFragmentProcessor> clone() const override; |
30 | const char* name() const override { return "AlphaThresholdFragmentProcessor" ; } |
31 | float innerThreshold; |
32 | float outerThreshold; |
33 | |
34 | private: |
35 | GrAlphaThresholdFragmentProcessor(std::unique_ptr<GrFragmentProcessor> inputFP, |
36 | std::unique_ptr<GrFragmentProcessor> maskFP, |
37 | float innerThreshold, |
38 | float outerThreshold) |
39 | : INHERITED(kGrAlphaThresholdFragmentProcessor_ClassID, |
40 | (OptimizationFlags)(inputFP ? ProcessorOptimizationFlags(inputFP.get()) |
41 | : kAll_OptimizationFlags) & |
42 | ((outerThreshold >= 1.0) ? kPreservesOpaqueInput_OptimizationFlag |
43 | : kNone_OptimizationFlags)) |
44 | , innerThreshold(innerThreshold) |
45 | , outerThreshold(outerThreshold) { |
46 | this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough()); |
47 | SkASSERT(maskFP); |
48 | this->registerChild(std::move(maskFP), SkSL::SampleUsage::PassThrough()); |
49 | } |
50 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
51 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
52 | bool onIsEqual(const GrFragmentProcessor&) const override; |
53 | #if GR_TEST_UTILS |
54 | SkString onDumpInfo() const override; |
55 | #endif |
56 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
57 | typedef GrFragmentProcessor INHERITED; |
58 | }; |
59 | #endif |
60 | |