1 | /* |
2 | * Copyright 2020 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 GrArithmeticProcessor.fp; do not modify. |
10 | **************************************************************************************************/ |
11 | #ifndef GrArithmeticProcessor_DEFINED |
12 | #define GrArithmeticProcessor_DEFINED |
13 | |
14 | #include "include/core/SkM44.h" |
15 | #include "include/core/SkTypes.h" |
16 | |
17 | #include "include/effects/SkArithmeticImageFilter.h" |
18 | |
19 | #include "src/gpu/GrFragmentProcessor.h" |
20 | |
21 | class GrArithmeticProcessor : public GrFragmentProcessor { |
22 | public: |
23 | static std::unique_ptr<GrFragmentProcessor> Make(std::unique_ptr<GrFragmentProcessor> srcFP, |
24 | std::unique_ptr<GrFragmentProcessor> dstFP, |
25 | const ArithmeticFPInputs& inputs) { |
26 | return std::unique_ptr<GrFragmentProcessor>(new GrArithmeticProcessor( |
27 | std::move(srcFP), std::move(dstFP), |
28 | SkV4{inputs.fK[0], inputs.fK[1], inputs.fK[2], inputs.fK[3]}, |
29 | inputs.fEnforcePMColor)); |
30 | } |
31 | GrArithmeticProcessor(const GrArithmeticProcessor& src); |
32 | std::unique_ptr<GrFragmentProcessor> clone() const override; |
33 | const char* name() const override { return "ArithmeticProcessor" ; } |
34 | SkV4 k; |
35 | bool enforcePMColor; |
36 | |
37 | private: |
38 | GrArithmeticProcessor(std::unique_ptr<GrFragmentProcessor> srcFP, |
39 | std::unique_ptr<GrFragmentProcessor> dstFP, |
40 | SkV4 k, |
41 | bool enforcePMColor) |
42 | : INHERITED(kGrArithmeticProcessor_ClassID, (OptimizationFlags)kNone_OptimizationFlags) |
43 | , k(k) |
44 | , enforcePMColor(enforcePMColor) { |
45 | this->registerChild(std::move(srcFP), SkSL::SampleUsage::PassThrough()); |
46 | SkASSERT(dstFP); |
47 | this->registerChild(std::move(dstFP), SkSL::SampleUsage::PassThrough()); |
48 | } |
49 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
50 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
51 | bool onIsEqual(const GrFragmentProcessor&) const override; |
52 | #if GR_TEST_UTILS |
53 | SkString onDumpInfo() const override; |
54 | #endif |
55 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
56 | typedef GrFragmentProcessor INHERITED; |
57 | }; |
58 | #endif |
59 | |