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" 16 #include "GrGradientShader.h" 17 #include "GrFragmentProcessor.h" 18 #include "GrCoordTransform.h" 19 class GrSweepGradientLayout : public GrFragmentProcessor { 20 public: gradientMatrix()21 const SkMatrix44& gradientMatrix() const { return fGradientMatrix; } bias()22 float bias() const { return fBias; } scale()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; name()29 const char* name() const override { return "SweepGradientLayout"; } 30 31 private: GrSweepGradientLayout(SkMatrix44 gradientMatrix,float bias,float scale)32 GrSweepGradientLayout(SkMatrix44 gradientMatrix, float bias, float scale) 33 : INHERITED(kGrSweepGradientLayout_ClassID, 34 (OptimizationFlags)kPreservesOpaqueInput_OptimizationFlag) 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 52