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