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