| 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 GrLinearGradientLayout.fp; do not modify. |
| 10 | **************************************************************************************************/ |
| 11 | #ifndef GrLinearGradientLayout_DEFINED |
| 12 | #define GrLinearGradientLayout_DEFINED |
| 13 | #include "include/core/SkTypes.h" |
| 14 | #include "include/core/SkM44.h" |
| 15 | |
| 16 | #include "src/gpu/gradients/GrGradientShader.h" |
| 17 | #include "src/shaders/gradients/SkLinearGradient.h" |
| 18 | |
| 19 | #include "src/gpu/GrCoordTransform.h" |
| 20 | #include "src/gpu/GrFragmentProcessor.h" |
| 21 | class GrLinearGradientLayout : public GrFragmentProcessor { |
| 22 | public: |
| 23 | static std::unique_ptr<GrFragmentProcessor> Make(const SkLinearGradient& gradient, |
| 24 | const GrFPArgs& args); |
| 25 | GrLinearGradientLayout(const GrLinearGradientLayout& src); |
| 26 | std::unique_ptr<GrFragmentProcessor> clone() const override; |
| 27 | const char* name() const override { return "LinearGradientLayout"; } |
| 28 | GrCoordTransform fCoordTransform0; |
| 29 | SkMatrix gradientMatrix; |
| 30 | |
| 31 | private: |
| 32 | GrLinearGradientLayout(SkMatrix gradientMatrix) |
| 33 | : INHERITED(kGrLinearGradientLayout_ClassID, |
| 34 | (OptimizationFlags)kPreservesOpaqueInput_OptimizationFlag) |
| 35 | , fCoordTransform0(gradientMatrix) |
| 36 | , gradientMatrix(gradientMatrix) { |
| 37 | this->addCoordTransform(&fCoordTransform0); |
| 38 | } |
| 39 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
| 40 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
| 41 | bool onIsEqual(const GrFragmentProcessor&) const override; |
| 42 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
| 43 | typedef GrFragmentProcessor INHERITED; |
| 44 | }; |
| 45 | #endif |
| 46 |