| 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 | |
| 14 | #include "include/core/SkM44.h" |
| 15 | #include "include/core/SkTypes.h" |
| 16 | |
| 17 | #include "src/gpu/effects/GrMatrixEffect.h" |
| 18 | #include "src/gpu/gradients/GrGradientShader.h" |
| 19 | #include "src/shaders/gradients/SkSweepGradient.h" |
| 20 | |
| 21 | #include "src/gpu/GrFragmentProcessor.h" |
| 22 | |
| 23 | class GrSweepGradientLayout : public GrFragmentProcessor { |
| 24 | public: |
| 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 | float bias; |
| 31 | float scale; |
| 32 | |
| 33 | private: |
| 34 | GrSweepGradientLayout(float bias, float scale) |
| 35 | : INHERITED(kGrSweepGradientLayout_ClassID, |
| 36 | (OptimizationFlags)kPreservesOpaqueInput_OptimizationFlag) |
| 37 | , bias(bias) |
| 38 | , scale(scale) { |
| 39 | this->setUsesSampleCoordsDirectly(); |
| 40 | } |
| 41 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
| 42 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
| 43 | bool onIsEqual(const GrFragmentProcessor&) const override; |
| 44 | #if GR_TEST_UTILS |
| 45 | SkString onDumpInfo() const override; |
| 46 | #endif |
| 47 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
| 48 | typedef GrFragmentProcessor INHERITED; |
| 49 | }; |
| 50 | #endif |
| 51 |