1 /* 2 * Copyright 2017 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 GrBlurredEdgeFragmentProcessor.fp; do not modify. 10 **************************************************************************************************/ 11 #ifndef GrBlurredEdgeFragmentProcessor_DEFINED 12 #define GrBlurredEdgeFragmentProcessor_DEFINED 13 #include "include/core/SkTypes.h" 14 15 #include "src/gpu/GrCoordTransform.h" 16 #include "src/gpu/GrFragmentProcessor.h" 17 class GrBlurredEdgeFragmentProcessor : public GrFragmentProcessor { 18 public: 19 enum class Mode { kGaussian = 0, kSmoothStep = 1 }; Make(Mode mode)20 static std::unique_ptr<GrFragmentProcessor> Make(Mode mode) { 21 return std::unique_ptr<GrFragmentProcessor>(new GrBlurredEdgeFragmentProcessor(mode)); 22 } 23 GrBlurredEdgeFragmentProcessor(const GrBlurredEdgeFragmentProcessor& src); 24 std::unique_ptr<GrFragmentProcessor> clone() const override; name()25 const char* name() const override { return "BlurredEdgeFragmentProcessor"; } 26 Mode mode; 27 28 private: GrBlurredEdgeFragmentProcessor(Mode mode)29 GrBlurredEdgeFragmentProcessor(Mode mode) 30 : INHERITED(kGrBlurredEdgeFragmentProcessor_ClassID, kNone_OptimizationFlags) 31 , mode(mode) {} 32 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; 33 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; 34 bool onIsEqual(const GrFragmentProcessor&) const override; 35 GR_DECLARE_FRAGMENT_PROCESSOR_TEST 36 typedef GrFragmentProcessor INHERITED; 37 }; 38 #endif 39