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" |
| 17 | #include "GrColorSpaceXform.h" |
Ethan Nicholas | 83d1185 | 2017-07-13 16:00:16 -0400 | [diff] [blame] | 18 | class GrCircleEffect : public GrFragmentProcessor { |
| 19 | public: |
| 20 | int edgeType() const { return fEdgeType; } |
| 21 | SkPoint center() const { return fCenter; } |
| 22 | float radius() const { return fRadius; } |
| 23 | static sk_sp<GrFragmentProcessor> Make(int edgeType, SkPoint center, float radius) { |
| 24 | return sk_sp<GrFragmentProcessor>(new GrCircleEffect(edgeType, center, radius)); |
| 25 | } |
Ethan Nicholas | f57c0d6 | 2017-07-31 11:18:22 -0400 | [diff] [blame] | 26 | GrCircleEffect(const GrCircleEffect& src); |
| 27 | sk_sp<GrFragmentProcessor> clone() const override; |
Ethan Nicholas | 83d1185 | 2017-07-13 16:00:16 -0400 | [diff] [blame] | 28 | const char* name() const override { return "CircleEffect"; } |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 29 | |
Ethan Nicholas | 83d1185 | 2017-07-13 16:00:16 -0400 | [diff] [blame] | 30 | private: |
| 31 | GrCircleEffect(int edgeType, SkPoint center, float radius) |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 32 | : INHERITED((OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag) |
| 33 | , fEdgeType(edgeType) |
| 34 | , fCenter(center) |
| 35 | , fRadius(radius) { |
Ethan Nicholas | 83d1185 | 2017-07-13 16:00:16 -0400 | [diff] [blame] | 36 | this->initClassID<GrCircleEffect>(); |
| 37 | } |
| 38 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 39 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
Ethan Nicholas | 83d1185 | 2017-07-13 16:00:16 -0400 | [diff] [blame] | 40 | bool onIsEqual(const GrFragmentProcessor&) const override; |
| 41 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
| 42 | int fEdgeType; |
| 43 | SkPoint fCenter; |
| 44 | float fRadius; |
| 45 | typedef GrFragmentProcessor INHERITED; |
| 46 | }; |
| 47 | #endif |
| 48 | #endif |