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