robertphillips | 30c4cae | 2015-09-15 10:20:55 -0700 | [diff] [blame] | 1 | /* |
Ethan Nicholas | 130fb3f | 2018-02-01 12:14:34 -0500 | [diff] [blame] | 2 | * Copyright 2018 Google Inc. |
robertphillips | 30c4cae | 2015-09-15 10:20:55 -0700 | [diff] [blame] | 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 | 130fb3f | 2018-02-01 12:14:34 -0500 | [diff] [blame] | 8 | /************************************************************************************************** |
| 9 | *** This file was autogenerated from GrCircleBlurFragmentProcessor.fp; do not modify. |
| 10 | **************************************************************************************************/ |
robertphillips | 30c4cae | 2015-09-15 10:20:55 -0700 | [diff] [blame] | 11 | #ifndef GrCircleBlurFragmentProcessor_DEFINED |
| 12 | #define GrCircleBlurFragmentProcessor_DEFINED |
robertphillips | 30c4cae | 2015-09-15 10:20:55 -0700 | [diff] [blame] | 13 | #include "SkTypes.h" |
robertphillips | 30c4cae | 2015-09-15 10:20:55 -0700 | [diff] [blame] | 14 | #include "GrFragmentProcessor.h" |
Ethan Nicholas | ceb4d48 | 2017-07-10 15:40:20 -0400 | [diff] [blame] | 15 | #include "GrCoordTransform.h" |
robertphillips | 30c4cae | 2015-09-15 10:20:55 -0700 | [diff] [blame] | 16 | class GrCircleBlurFragmentProcessor : public GrFragmentProcessor { |
| 17 | public: |
Michael Ludwig | a427559 | 2018-08-31 10:52:47 -0400 | [diff] [blame] | 18 | const SkRect& circleRect() const { return fCircleRect; } |
Ethan Nicholas | ceb4d48 | 2017-07-10 15:40:20 -0400 | [diff] [blame] | 19 | float textureRadius() const { return fTextureRadius; } |
| 20 | float solidRadius() const { return fSolidRadius; } |
Robert Phillips | 1c9686b | 2017-06-30 08:40:28 -0400 | [diff] [blame] | 21 | |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 22 | static std::unique_ptr<GrFragmentProcessor> Make(GrProxyProvider*, const SkRect& circle, |
| 23 | float sigma); |
Ethan Nicholas | f57c0d6 | 2017-07-31 11:18:22 -0400 | [diff] [blame] | 24 | GrCircleBlurFragmentProcessor(const GrCircleBlurFragmentProcessor& src); |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 25 | std::unique_ptr<GrFragmentProcessor> clone() const override; |
Ethan Nicholas | ceb4d48 | 2017-07-10 15:40:20 -0400 | [diff] [blame] | 26 | const char* name() const override { return "CircleBlurFragmentProcessor"; } |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 27 | |
Ethan Nicholas | 818ac5a | 2017-07-10 13:12:07 +0000 | [diff] [blame] | 28 | private: |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 29 | GrCircleBlurFragmentProcessor(SkRect circleRect, float textureRadius, float solidRadius, |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 30 | sk_sp<GrTextureProxy> blurProfileSampler) |
Ethan Nicholas | abff956 | 2017-10-09 10:54:08 -0400 | [diff] [blame] | 31 | : INHERITED(kGrCircleBlurFragmentProcessor_ClassID, |
| 32 | (OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag) |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 33 | , fCircleRect(circleRect) |
| 34 | , fTextureRadius(textureRadius) |
| 35 | , fSolidRadius(solidRadius) |
| 36 | , fBlurProfileSampler(std::move(blurProfileSampler)) { |
Brian Salomon | f7dcd76 | 2018-07-30 14:48:15 -0400 | [diff] [blame] | 37 | this->setTextureSamplerCnt(1); |
Ethan Nicholas | 818ac5a | 2017-07-10 13:12:07 +0000 | [diff] [blame] | 38 | } |
Ethan Nicholas | ceb4d48 | 2017-07-10 15:40:20 -0400 | [diff] [blame] | 39 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
Ethan Nicholas | b7e8c3b | 2017-07-19 13:54:20 -0400 | [diff] [blame] | 40 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
Ethan Nicholas | ceb4d48 | 2017-07-10 15:40:20 -0400 | [diff] [blame] | 41 | bool onIsEqual(const GrFragmentProcessor&) const override; |
Brian Salomon | f7dcd76 | 2018-07-30 14:48:15 -0400 | [diff] [blame] | 42 | const TextureSampler& onTextureSampler(int) const override; |
Brian Salomon | 0c26a9d | 2017-07-06 10:09:38 -0400 | [diff] [blame] | 43 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
Ethan Nicholas | ceb4d48 | 2017-07-10 15:40:20 -0400 | [diff] [blame] | 44 | SkRect fCircleRect; |
| 45 | float fTextureRadius; |
| 46 | float fSolidRadius; |
| 47 | TextureSampler fBlurProfileSampler; |
robertphillips | 30c4cae | 2015-09-15 10:20:55 -0700 | [diff] [blame] | 48 | typedef GrFragmentProcessor INHERITED; |
| 49 | }; |
robertphillips | 30c4cae | 2015-09-15 10:20:55 -0700 | [diff] [blame] | 50 | #endif |