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 GrTiledGradientEffect.fp; do not modify. |
10 | **************************************************************************************************/ |
11 | #ifndef GrTiledGradientEffect_DEFINED |
12 | #define GrTiledGradientEffect_DEFINED |
13 | |
14 | #include "include/core/SkM44.h" |
15 | #include "include/core/SkTypes.h" |
16 | |
17 | #include "src/gpu/GrFragmentProcessor.h" |
18 | |
19 | class GrTiledGradientEffect : public GrFragmentProcessor { |
20 | public: |
21 | static std::unique_ptr<GrFragmentProcessor> Make( |
22 | std::unique_ptr<GrFragmentProcessor> colorizer, |
23 | std::unique_ptr<GrFragmentProcessor> gradLayout, |
24 | bool mirror, |
25 | bool makePremul, |
26 | bool colorsAreOpaque) { |
27 | return std::unique_ptr<GrFragmentProcessor>(new GrTiledGradientEffect( |
28 | std::move(colorizer), std::move(gradLayout), mirror, makePremul, colorsAreOpaque)); |
29 | } |
30 | GrTiledGradientEffect(const GrTiledGradientEffect& src); |
31 | std::unique_ptr<GrFragmentProcessor> clone() const override; |
32 | const char* name() const override { return "TiledGradientEffect" ; } |
33 | bool mirror; |
34 | bool makePremul; |
35 | bool colorsAreOpaque; |
36 | |
37 | private: |
38 | GrTiledGradientEffect(std::unique_ptr<GrFragmentProcessor> colorizer, |
39 | std::unique_ptr<GrFragmentProcessor> gradLayout, |
40 | bool mirror, |
41 | bool makePremul, |
42 | bool colorsAreOpaque) |
43 | : INHERITED(kGrTiledGradientEffect_ClassID, |
44 | (OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag | |
45 | (colorsAreOpaque && gradLayout->preservesOpaqueInput() |
46 | ? kPreservesOpaqueInput_OptimizationFlag |
47 | : kNone_OptimizationFlags)) |
48 | , mirror(mirror) |
49 | , makePremul(makePremul) |
50 | , colorsAreOpaque(colorsAreOpaque) { |
51 | SkASSERT(colorizer); |
52 | this->registerChild(std::move(colorizer), SkSL::SampleUsage::Explicit()); |
53 | SkASSERT(gradLayout); |
54 | this->registerChild(std::move(gradLayout), SkSL::SampleUsage::PassThrough()); |
55 | } |
56 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
57 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
58 | bool onIsEqual(const GrFragmentProcessor&) const override; |
59 | #if GR_TEST_UTILS |
60 | SkString onDumpInfo() const override; |
61 | #endif |
62 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
63 | typedef GrFragmentProcessor INHERITED; |
64 | }; |
65 | #endif |
66 | |