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 GrTwoPointConicalGradientLayout.fp; do not modify. 10 **************************************************************************************************/ 11 #ifndef GrTwoPointConicalGradientLayout_DEFINED 12 #define GrTwoPointConicalGradientLayout_DEFINED 13 #include "include/core/SkTypes.h" 14 15 #include "src/gpu/gradients/GrGradientShader.h" 16 #include "src/shaders/gradients/SkTwoPointConicalGradient.h" 17 18 #include "src/gpu/GrCoordTransform.h" 19 #include "src/gpu/GrFragmentProcessor.h" 20 class GrTwoPointConicalGradientLayout : public GrFragmentProcessor { 21 public: 22 enum class Type { kFocal = 2, kRadial = 0, kStrip = 1 }; 23 24 static std::unique_ptr<GrFragmentProcessor> Make(const SkTwoPointConicalGradient& gradient, 25 const GrFPArgs& args); 26 GrTwoPointConicalGradientLayout(const GrTwoPointConicalGradientLayout& src); 27 std::unique_ptr<GrFragmentProcessor> clone() const override; name()28 const char* name() const override { return "TwoPointConicalGradientLayout"; } 29 GrCoordTransform fCoordTransform0; 30 SkMatrix44 gradientMatrix; 31 Type type; 32 bool isRadiusIncreasing; 33 bool isFocalOnCircle; 34 bool isWellBehaved; 35 bool isSwapped; 36 bool isNativelyFocal; 37 SkPoint focalParams; 38 39 private: GrTwoPointConicalGradientLayout(SkMatrix44 gradientMatrix,Type type,bool isRadiusIncreasing,bool isFocalOnCircle,bool isWellBehaved,bool isSwapped,bool isNativelyFocal,SkPoint focalParams)40 GrTwoPointConicalGradientLayout(SkMatrix44 gradientMatrix, Type type, bool isRadiusIncreasing, 41 bool isFocalOnCircle, bool isWellBehaved, bool isSwapped, 42 bool isNativelyFocal, SkPoint focalParams) 43 : INHERITED(kGrTwoPointConicalGradientLayout_ClassID, 44 (OptimizationFlags)kNone_OptimizationFlags) 45 , fCoordTransform0(gradientMatrix) 46 , gradientMatrix(gradientMatrix) 47 , type(type) 48 , isRadiusIncreasing(isRadiusIncreasing) 49 , isFocalOnCircle(isFocalOnCircle) 50 , isWellBehaved(isWellBehaved) 51 , isSwapped(isSwapped) 52 , isNativelyFocal(isNativelyFocal) 53 , focalParams(focalParams) { 54 this->addCoordTransform(&fCoordTransform0); 55 } 56 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; 57 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; 58 bool onIsEqual(const GrFragmentProcessor&) const override; 59 GR_DECLARE_FRAGMENT_PROCESSOR_TEST 60 typedef GrFragmentProcessor INHERITED; 61 }; 62 #endif 63