Michael Ludwig | 4f94ef6 | 2018-09-12 15:22:16 -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 GrLinearGradientLayout.fp; do not modify. |
| 10 | **************************************************************************************************/ |
| 11 | #ifndef GrLinearGradientLayout_DEFINED |
| 12 | #define GrLinearGradientLayout_DEFINED |
| 13 | #include "SkTypes.h" |
| 14 | |
| 15 | #include "SkLinearGradient.h" |
Michael Ludwig | 7f8c524 | 2018-09-14 15:07:55 -0400 | [diff] [blame] | 16 | #include "GrGradientShader.h" |
Michael Ludwig | 4f94ef6 | 2018-09-12 15:22:16 -0400 | [diff] [blame] | 17 | #include "GrFragmentProcessor.h" |
| 18 | #include "GrCoordTransform.h" |
| 19 | class GrLinearGradientLayout : public GrFragmentProcessor { |
| 20 | public: |
| 21 | const SkMatrix44& gradientMatrix() const { return fGradientMatrix; } |
| 22 | |
| 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 | |
| 29 | private: |
| 30 | GrLinearGradientLayout(SkMatrix44 gradientMatrix) |
Michael Ludwig | b96cba3 | 2018-09-14 13:59:24 -0400 | [diff] [blame] | 31 | : INHERITED(kGrLinearGradientLayout_ClassID, |
| 32 | (OptimizationFlags)kPreservesOpaqueInput_OptimizationFlag) |
Michael Ludwig | 4f94ef6 | 2018-09-12 15:22:16 -0400 | [diff] [blame] | 33 | , fGradientMatrix(gradientMatrix) |
| 34 | , fCoordTransform0(gradientMatrix) { |
| 35 | this->addCoordTransform(&fCoordTransform0); |
| 36 | } |
| 37 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
| 38 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
| 39 | bool onIsEqual(const GrFragmentProcessor&) const override; |
| 40 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
| 41 | SkMatrix44 fGradientMatrix; |
| 42 | GrCoordTransform fCoordTransform0; |
| 43 | typedef GrFragmentProcessor INHERITED; |
| 44 | }; |
| 45 | #endif |