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 "SkTypes.h" 14 #include "GrFragmentProcessor.h" 15 #include "GrCoordTransform.h" 16 class GrTiledGradientEffect : public GrFragmentProcessor { 17 public: mirror()18 bool mirror() const { return fMirror; } makePremul()19 bool makePremul() const { return fMakePremul; } colorsAreOpaque()20 bool colorsAreOpaque() const { return fColorsAreOpaque; } Make(std::unique_ptr<GrFragmentProcessor> colorizer,std::unique_ptr<GrFragmentProcessor> gradLayout,bool mirror,bool makePremul,bool colorsAreOpaque)21 static std::unique_ptr<GrFragmentProcessor> Make( 22 std::unique_ptr<GrFragmentProcessor> colorizer, 23 std::unique_ptr<GrFragmentProcessor> gradLayout, bool mirror, bool makePremul, 24 bool colorsAreOpaque) { 25 return std::unique_ptr<GrFragmentProcessor>(new GrTiledGradientEffect( 26 std::move(colorizer), std::move(gradLayout), mirror, makePremul, colorsAreOpaque)); 27 } 28 GrTiledGradientEffect(const GrTiledGradientEffect& src); 29 std::unique_ptr<GrFragmentProcessor> clone() const override; name()30 const char* name() const override { return "TiledGradientEffect"; } 31 32 private: GrTiledGradientEffect(std::unique_ptr<GrFragmentProcessor> colorizer,std::unique_ptr<GrFragmentProcessor> gradLayout,bool mirror,bool makePremul,bool colorsAreOpaque)33 GrTiledGradientEffect(std::unique_ptr<GrFragmentProcessor> colorizer, 34 std::unique_ptr<GrFragmentProcessor> gradLayout, bool mirror, 35 bool makePremul, bool colorsAreOpaque) 36 : INHERITED(kGrTiledGradientEffect_ClassID, 37 (OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag | 38 (colorsAreOpaque && gradLayout->preservesOpaqueInput() 39 ? kPreservesOpaqueInput_OptimizationFlag 40 : kNone_OptimizationFlags)) 41 , fMirror(mirror) 42 , fMakePremul(makePremul) 43 , fColorsAreOpaque(colorsAreOpaque) { 44 this->registerChildProcessor(std::move(colorizer)); 45 this->registerChildProcessor(std::move(gradLayout)); 46 } 47 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; 48 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; 49 bool onIsEqual(const GrFragmentProcessor&) const override; 50 GR_DECLARE_FRAGMENT_PROCESSOR_TEST 51 bool fMirror; 52 bool fMakePremul; 53 bool fColorsAreOpaque; 54 typedef GrFragmentProcessor INHERITED; 55 }; 56 #endif 57