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 GrTiledGradientEffect.fp; do not modify. 10 **************************************************************************************************/ 11 #ifndef GrTiledGradientEffect_DEFINED 12 #define GrTiledGradientEffect_DEFINED 13 #include "include/core/SkTypes.h" 14 #include "include/core/SkM44.h" 15 16 #include "src/gpu/GrCoordTransform.h" 17 #include "src/gpu/GrFragmentProcessor.h" 18 class GrTiledGradientEffect : public GrFragmentProcessor { 19 public: Make(std::unique_ptr<GrFragmentProcessor> colorizer,std::unique_ptr<GrFragmentProcessor> gradLayout,bool mirror,bool makePremul,bool colorsAreOpaque)20 static std::unique_ptr<GrFragmentProcessor> Make( 21 std::unique_ptr<GrFragmentProcessor> colorizer, 22 std::unique_ptr<GrFragmentProcessor> gradLayout, bool mirror, bool makePremul, 23 bool colorsAreOpaque) { 24 return std::unique_ptr<GrFragmentProcessor>(new GrTiledGradientEffect( 25 std::move(colorizer), std::move(gradLayout), mirror, makePremul, colorsAreOpaque)); 26 } 27 GrTiledGradientEffect(const GrTiledGradientEffect& src); 28 std::unique_ptr<GrFragmentProcessor> clone() const override; name()29 const char* name() const override { return "TiledGradientEffect"; } 30 int colorizer_index = -1; 31 int gradLayout_index = -1; 32 bool mirror; 33 bool makePremul; 34 bool colorsAreOpaque; 35 36 private: GrTiledGradientEffect(std::unique_ptr<GrFragmentProcessor> colorizer,std::unique_ptr<GrFragmentProcessor> gradLayout,bool mirror,bool makePremul,bool colorsAreOpaque)37 GrTiledGradientEffect(std::unique_ptr<GrFragmentProcessor> colorizer, 38 std::unique_ptr<GrFragmentProcessor> gradLayout, bool mirror, 39 bool makePremul, bool colorsAreOpaque) 40 : INHERITED(kGrTiledGradientEffect_ClassID, 41 (OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag | 42 (colorsAreOpaque && gradLayout->preservesOpaqueInput() 43 ? kPreservesOpaqueInput_OptimizationFlag 44 : kNone_OptimizationFlags)) 45 , mirror(mirror) 46 , makePremul(makePremul) 47 , colorsAreOpaque(colorsAreOpaque) { 48 SkASSERT(colorizer); 49 colorizer_index = this->numChildProcessors(); 50 this->registerChildProcessor(std::move(colorizer)); 51 SkASSERT(gradLayout); 52 gradLayout_index = this->numChildProcessors(); 53 this->registerChildProcessor(std::move(gradLayout)); 54 } 55 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; 56 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; 57 bool onIsEqual(const GrFragmentProcessor&) const override; 58 GR_DECLARE_FRAGMENT_PROCESSOR_TEST 59 typedef GrFragmentProcessor INHERITED; 60 }; 61 #endif 62