Michael Ludwig | 24d438b | 2018-09-12 15:22:50 -0400 | [diff] [blame] | 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 GrSweepGradientLayout.fp; do not modify. |
| 10 | **************************************************************************************************/ |
| 11 | #ifndef GrSweepGradientLayout_DEFINED |
| 12 | #define GrSweepGradientLayout_DEFINED |
| 13 | #include "SkTypes.h" |
| 14 | |
| 15 | #include "SkSweepGradient.h" |
Michael Ludwig | 7f8c524 | 2018-09-14 15:07:55 -0400 | [diff] [blame] | 16 | #include "GrGradientShader.h" |
Michael Ludwig | 24d438b | 2018-09-12 15:22:50 -0400 | [diff] [blame] | 17 | #include "GrFragmentProcessor.h" |
| 18 | #include "GrCoordTransform.h" |
| 19 | class GrSweepGradientLayout : public GrFragmentProcessor { |
| 20 | public: |
| 21 | const SkMatrix44& gradientMatrix() const { return fGradientMatrix; } |
| 22 | float bias() const { return fBias; } |
| 23 | float scale() const { return fScale; } |
| 24 | |
| 25 | static std::unique_ptr<GrFragmentProcessor> Make(const SkSweepGradient& gradient, |
| 26 | const GrFPArgs& args); |
| 27 | GrSweepGradientLayout(const GrSweepGradientLayout& src); |
| 28 | std::unique_ptr<GrFragmentProcessor> clone() const override; |
| 29 | const char* name() const override { return "SweepGradientLayout"; } |
| 30 | |
| 31 | private: |
| 32 | GrSweepGradientLayout(SkMatrix44 gradientMatrix, float bias, float scale) |
Michael Ludwig | b96cba3 | 2018-09-14 13:59:24 -0400 | [diff] [blame] | 33 | : INHERITED(kGrSweepGradientLayout_ClassID, |
| 34 | (OptimizationFlags)kPreservesOpaqueInput_OptimizationFlag) |
Michael Ludwig | 24d438b | 2018-09-12 15:22:50 -0400 | [diff] [blame] | 35 | , fGradientMatrix(gradientMatrix) |
| 36 | , fBias(bias) |
| 37 | , fScale(scale) |
| 38 | , fCoordTransform0(gradientMatrix) { |
| 39 | this->addCoordTransform(&fCoordTransform0); |
| 40 | } |
| 41 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
| 42 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
| 43 | bool onIsEqual(const GrFragmentProcessor&) const override; |
| 44 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
| 45 | SkMatrix44 fGradientMatrix; |
| 46 | float fBias; |
| 47 | float fScale; |
| 48 | GrCoordTransform fCoordTransform0; |
| 49 | typedef GrFragmentProcessor INHERITED; |
| 50 | }; |
| 51 | #endif |