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 GrTextureGradientColorizer.fp; do not modify. 10 **************************************************************************************************/ 11 #ifndef GrTextureGradientColorizer_DEFINED 12 #define GrTextureGradientColorizer_DEFINED 13 #include "SkTypes.h" 14 #include "GrFragmentProcessor.h" 15 #include "GrCoordTransform.h" 16 class GrTextureGradientColorizer : public GrFragmentProcessor { 17 public: Make(sk_sp<GrTextureProxy> gradient)18 static std::unique_ptr<GrFragmentProcessor> Make(sk_sp<GrTextureProxy> gradient) { 19 return std::unique_ptr<GrFragmentProcessor>(new GrTextureGradientColorizer(gradient)); 20 } 21 GrTextureGradientColorizer(const GrTextureGradientColorizer& src); 22 std::unique_ptr<GrFragmentProcessor> clone() const override; name()23 const char* name() const override { return "TextureGradientColorizer"; } 24 25 private: GrTextureGradientColorizer(sk_sp<GrTextureProxy> gradient)26 GrTextureGradientColorizer(sk_sp<GrTextureProxy> gradient) 27 : INHERITED(kGrTextureGradientColorizer_ClassID, kNone_OptimizationFlags) 28 , fGradient(std::move(gradient), GrSamplerState::ClampBilerp()) { 29 this->setTextureSamplerCnt(1); 30 } 31 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; 32 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; 33 bool onIsEqual(const GrFragmentProcessor&) const override; 34 const TextureSampler& onTextureSampler(int) const override; 35 GR_DECLARE_FRAGMENT_PROCESSOR_TEST 36 TextureSampler fGradient; 37 typedef GrFragmentProcessor INHERITED; 38 }; 39 #endif 40