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 GrSingleIntervalGradientColorizer.fp; do not modify. 10 **************************************************************************************************/ 11 #ifndef GrSingleIntervalGradientColorizer_DEFINED 12 #define GrSingleIntervalGradientColorizer_DEFINED 13 #include "SkTypes.h" 14 #include "GrFragmentProcessor.h" 15 #include "GrCoordTransform.h" 16 class GrSingleIntervalGradientColorizer : public GrFragmentProcessor { 17 public: 18 const SkPMColor4f& start() const { return fStart; } 19 const SkPMColor4f& end() const { return fEnd; } 20 static std::unique_ptr<GrFragmentProcessor> Make(SkPMColor4f start, SkPMColor4f end) { 21 return std::unique_ptr<GrFragmentProcessor>( 22 new GrSingleIntervalGradientColorizer(start, end)); 23 } 24 GrSingleIntervalGradientColorizer(const GrSingleIntervalGradientColorizer& src); 25 std::unique_ptr<GrFragmentProcessor> clone() const override; 26 const char* name() const override { return "SingleIntervalGradientColorizer"; } 27 28 private: 29 GrSingleIntervalGradientColorizer(SkPMColor4f start, SkPMColor4f end) 30 : INHERITED(kGrSingleIntervalGradientColorizer_ClassID, kNone_OptimizationFlags) 31 , fStart(start) 32 , fEnd(end) {} 33 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; 34 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; 35 bool onIsEqual(const GrFragmentProcessor&) const override; 36 GR_DECLARE_FRAGMENT_PROCESSOR_TEST 37 SkPMColor4f fStart; 38 SkPMColor4f fEnd; 39 typedef GrFragmentProcessor INHERITED; 40 }; 41 #endif 42