Jim Van Verth | 91af727 | 2017-01-27 14:15:54 -0500 | [diff] [blame] | 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 | |
Ethan Nicholas | 0274b30 | 2017-07-14 16:17:04 -0400 | [diff] [blame] | 8 | /* |
| 9 | * This file was autogenerated from GrBlurredEdgeFragmentProcessor.fp; do not modify. |
| 10 | */ |
Jim Van Verth | 91af727 | 2017-01-27 14:15:54 -0500 | [diff] [blame] | 11 | #ifndef GrBlurredEdgeFragmentProcessor_DEFINED |
| 12 | #define GrBlurredEdgeFragmentProcessor_DEFINED |
Ethan Nicholas | 0274b30 | 2017-07-14 16:17:04 -0400 | [diff] [blame] | 13 | #include "SkTypes.h" |
| 14 | #if SK_SUPPORT_GPU |
Jim Van Verth | 91af727 | 2017-01-27 14:15:54 -0500 | [diff] [blame] | 15 | #include "GrFragmentProcessor.h" |
Ethan Nicholas | 0274b30 | 2017-07-14 16:17:04 -0400 | [diff] [blame] | 16 | #include "GrCoordTransform.h" |
| 17 | #include "GrColorSpaceXform.h" |
Ethan Nicholas | 0274b30 | 2017-07-14 16:17:04 -0400 | [diff] [blame] | 18 | class GrBlurredEdgeFragmentProcessor : public GrFragmentProcessor { |
Jim Van Verth | 91af727 | 2017-01-27 14:15:54 -0500 | [diff] [blame] | 19 | public: |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 20 | enum Mode { kGaussian_Mode = 0, kSmoothStep_Mode = 1 }; |
Ethan Nicholas | 0274b30 | 2017-07-14 16:17:04 -0400 | [diff] [blame] | 21 | int mode() const { return fMode; } |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 22 | static std::unique_ptr<GrFragmentProcessor> Make(int mode) { |
| 23 | return std::unique_ptr<GrFragmentProcessor>(new GrBlurredEdgeFragmentProcessor(mode)); |
Jim Van Verth | 91af727 | 2017-01-27 14:15:54 -0500 | [diff] [blame] | 24 | } |
Ethan Nicholas | f57c0d6 | 2017-07-31 11:18:22 -0400 | [diff] [blame] | 25 | GrBlurredEdgeFragmentProcessor(const GrBlurredEdgeFragmentProcessor& src); |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 26 | std::unique_ptr<GrFragmentProcessor> clone() const override; |
Ethan Nicholas | 0274b30 | 2017-07-14 16:17:04 -0400 | [diff] [blame] | 27 | const char* name() const override { return "BlurredEdgeFragmentProcessor"; } |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 28 | |
Jim Van Verth | 91af727 | 2017-01-27 14:15:54 -0500 | [diff] [blame] | 29 | private: |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 30 | GrBlurredEdgeFragmentProcessor(int mode) : INHERITED(kNone_OptimizationFlags), fMode(mode) { |
Ethan Nicholas | 0274b30 | 2017-07-14 16:17:04 -0400 | [diff] [blame] | 31 | this->initClassID<GrBlurredEdgeFragmentProcessor>(); |
Jim Van Verth | 91af727 | 2017-01-27 14:15:54 -0500 | [diff] [blame] | 32 | } |
Jim Van Verth | 91af727 | 2017-01-27 14:15:54 -0500 | [diff] [blame] | 33 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 34 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
Jim Van Verth | 91af727 | 2017-01-27 14:15:54 -0500 | [diff] [blame] | 35 | bool onIsEqual(const GrFragmentProcessor&) const override; |
Brian Salomon | 0c26a9d | 2017-07-06 10:09:38 -0400 | [diff] [blame] | 36 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
Ethan Nicholas | 0274b30 | 2017-07-14 16:17:04 -0400 | [diff] [blame] | 37 | int fMode; |
Jim Van Verth | 91af727 | 2017-01-27 14:15:54 -0500 | [diff] [blame] | 38 | typedef GrFragmentProcessor INHERITED; |
| 39 | }; |
Ethan Nicholas | 0274b30 | 2017-07-14 16:17:04 -0400 | [diff] [blame] | 40 | #endif |
Jim Van Verth | 91af727 | 2017-01-27 14:15:54 -0500 | [diff] [blame] | 41 | #endif |