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 15 #include "src/gpu/GrCoordTransform.h" 16 #include "src/gpu/GrFragmentProcessor.h" 17 class GrTiledGradientEffect : public GrFragmentProcessor { 18 public: Make(std::unique_ptr<GrFragmentProcessor> colorizer,std::unique_ptr<GrFragmentProcessor> gradLayout,bool mirror,bool makePremul,bool colorsAreOpaque)19 static std::unique_ptr<GrFragmentProcessor> Make( 20 std::unique_ptr<GrFragmentProcessor> colorizer, 21 std::unique_ptr<GrFragmentProcessor> gradLayout, bool mirror, bool makePremul, 22 bool colorsAreOpaque) { 23 return std::unique_ptr<GrFragmentProcessor>(new GrTiledGradientEffect( 24 std::move(colorizer), std::move(gradLayout), mirror, makePremul, colorsAreOpaque)); 25 } 26 GrTiledGradientEffect(const GrTiledGradientEffect& src); 27 std::unique_ptr<GrFragmentProcessor> clone() const override; name()28 const char* name() const override { return "TiledGradientEffect"; } 29 int colorizer_index = -1; 30 int gradLayout_index = -1; 31 bool mirror; 32 bool makePremul; 33 bool colorsAreOpaque; 34 35 private: GrTiledGradientEffect(std::unique_ptr<GrFragmentProcessor> colorizer,std::unique_ptr<GrFragmentProcessor> gradLayout,bool mirror,bool makePremul,bool colorsAreOpaque)36 GrTiledGradientEffect(std::unique_ptr<GrFragmentProcessor> colorizer, 37 std::unique_ptr<GrFragmentProcessor> gradLayout, bool mirror, 38 bool makePremul, bool colorsAreOpaque) 39 : INHERITED(kGrTiledGradientEffect_ClassID, 40 (OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag | 41 (colorsAreOpaque && gradLayout->preservesOpaqueInput() 42 ? kPreservesOpaqueInput_OptimizationFlag 43 : kNone_OptimizationFlags)) 44 , mirror(mirror) 45 , makePremul(makePremul) 46 , colorsAreOpaque(colorsAreOpaque) { 47 SkASSERT(colorizer); 48 colorizer_index = this->numChildProcessors(); 49 this->registerChildProcessor(std::move(colorizer)); 50 SkASSERT(gradLayout); 51 gradLayout_index = this->numChildProcessors(); 52 this->registerChildProcessor(std::move(gradLayout)); 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 typedef GrFragmentProcessor INHERITED; 59 }; 60 #endif 61