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 "include/core/SkTypes.h" 14 15 #include "src/gpu/gradients/GrGradientShader.h" 16 #include "src/shaders/gradients/SkSweepGradient.h" 17 18 #include "src/gpu/GrCoordTransform.h" 19 #include "src/gpu/GrFragmentProcessor.h" 20 class GrSweepGradientLayout : public GrFragmentProcessor { 21 public: 22 static std::unique_ptr<GrFragmentProcessor> Make(const SkSweepGradient& gradient, 23 const GrFPArgs& args); 24 GrSweepGradientLayout(const GrSweepGradientLayout& src); 25 std::unique_ptr<GrFragmentProcessor> clone() const override; name()26 const char* name() const override { return "SweepGradientLayout"; } 27 GrCoordTransform fCoordTransform0; 28 SkMatrix44 gradientMatrix; 29 float bias; 30 float scale; 31 32 private: GrSweepGradientLayout(SkMatrix44 gradientMatrix,float bias,float scale)33 GrSweepGradientLayout(SkMatrix44 gradientMatrix, float bias, float scale) 34 : INHERITED(kGrSweepGradientLayout_ClassID, 35 (OptimizationFlags)kPreservesOpaqueInput_OptimizationFlag) 36 , fCoordTransform0(gradientMatrix) 37 , gradientMatrix(gradientMatrix) 38 , bias(bias) 39 , scale(scale) { 40 this->addCoordTransform(&fCoordTransform0); 41 } 42 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; 43 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; 44 bool onIsEqual(const GrFragmentProcessor&) const override; 45 GR_DECLARE_FRAGMENT_PROCESSOR_TEST 46 typedef GrFragmentProcessor INHERITED; 47 }; 48 #endif 49