Ethan Nicholas | 83d1185 | 2017-07-13 16:00:16 -0400 | [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 | |
| 8 | /* |
| 9 | * This file was autogenerated from GrCircleEffect.fp; do not modify. |
| 10 | */ |
| 11 | #ifndef GrCircleEffect_DEFINED |
| 12 | #define GrCircleEffect_DEFINED |
| 13 | #include "SkTypes.h" |
| 14 | #if SK_SUPPORT_GPU |
| 15 | #include "GrFragmentProcessor.h" |
| 16 | #include "GrCoordTransform.h" |
Ethan Nicholas | 83d1185 | 2017-07-13 16:00:16 -0400 | [diff] [blame] | 17 | class GrCircleEffect : public GrFragmentProcessor { |
| 18 | public: |
| 19 | int edgeType() const { return fEdgeType; } |
| 20 | SkPoint center() const { return fCenter; } |
| 21 | float radius() const { return fRadius; } |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 22 | static std::unique_ptr<GrFragmentProcessor> Make(int edgeType, SkPoint center, float radius) { |
| 23 | return std::unique_ptr<GrFragmentProcessor>(new GrCircleEffect(edgeType, center, radius)); |
Ethan Nicholas | 83d1185 | 2017-07-13 16:00:16 -0400 | [diff] [blame] | 24 | } |
Ethan Nicholas | f57c0d6 | 2017-07-31 11:18:22 -0400 | [diff] [blame] | 25 | GrCircleEffect(const GrCircleEffect& src); |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 26 | std::unique_ptr<GrFragmentProcessor> clone() const override; |
Ethan Nicholas | 83d1185 | 2017-07-13 16:00:16 -0400 | [diff] [blame] | 27 | const char* name() const override { return "CircleEffect"; } |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 28 | |
Ethan Nicholas | 83d1185 | 2017-07-13 16:00:16 -0400 | [diff] [blame] | 29 | private: |
| 30 | GrCircleEffect(int edgeType, SkPoint center, float radius) |
Ethan Nicholas | abff956 | 2017-10-09 10:54:08 -0400 | [diff] [blame] | 31 | : INHERITED(kGrCircleEffect_ClassID, |
| 32 | (OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag) |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 33 | , fEdgeType(edgeType) |
| 34 | , fCenter(center) |
Ethan Nicholas | abff956 | 2017-10-09 10:54:08 -0400 | [diff] [blame] | 35 | , fRadius(radius) {} |
Ethan Nicholas | 83d1185 | 2017-07-13 16:00:16 -0400 | [diff] [blame] | 36 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 37 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
Ethan Nicholas | 83d1185 | 2017-07-13 16:00:16 -0400 | [diff] [blame] | 38 | bool onIsEqual(const GrFragmentProcessor&) const override; |
| 39 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
| 40 | int fEdgeType; |
| 41 | SkPoint fCenter; |
| 42 | float fRadius; |
| 43 | typedef GrFragmentProcessor INHERITED; |
| 44 | }; |
| 45 | #endif |
| 46 | #endif |