| 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 | |
| 14 | #include "include/core/SkM44.h" |
| 15 | #include "include/core/SkTypes.h" |
| 16 | |
| 17 | #include "src/gpu/GrFragmentProcessor.h" |
| 18 | |
| 19 | class GrBlurredEdgeFragmentProcessor : public GrFragmentProcessor { |
| 20 | public: |
| 21 | enum class Mode { kGaussian = 0, kSmoothStep = 1 }; |
| 22 | static std::unique_ptr<GrFragmentProcessor> Make(std::unique_ptr<GrFragmentProcessor> inputFP, |
| 23 | Mode mode) { |
| 24 | return std::unique_ptr<GrFragmentProcessor>( |
| 25 | new GrBlurredEdgeFragmentProcessor(std::move(inputFP), mode)); |
| 26 | } |
| 27 | GrBlurredEdgeFragmentProcessor(const GrBlurredEdgeFragmentProcessor& src); |
| 28 | std::unique_ptr<GrFragmentProcessor> clone() const override; |
| 29 | const char* name() const override { return "BlurredEdgeFragmentProcessor"; } |
| 30 | Mode mode; |
| 31 | |
| 32 | private: |
| 33 | GrBlurredEdgeFragmentProcessor(std::unique_ptr<GrFragmentProcessor> inputFP, Mode mode) |
| 34 | : INHERITED(kGrBlurredEdgeFragmentProcessor_ClassID, kNone_OptimizationFlags) |
| 35 | , mode(mode) { |
| 36 | this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough()); |
| 37 | } |
| 38 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
| 39 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
| 40 | bool onIsEqual(const GrFragmentProcessor&) const override; |
| 41 | #if GR_TEST_UTILS |
| 42 | SkString onDumpInfo() const override; |
| 43 | #endif |
| 44 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
| 45 | typedef GrFragmentProcessor INHERITED; |
| 46 | }; |
| 47 | #endif |
| 48 |