1 /*
2  * Copyright 2018 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 GrCircleBlurFragmentProcessor.fp; do not modify.
10  **************************************************************************************************/
11 #ifndef GrCircleBlurFragmentProcessor_DEFINED
12 #define GrCircleBlurFragmentProcessor_DEFINED
13 #include "SkTypes.h"
14 #include "GrFragmentProcessor.h"
15 #include "GrCoordTransform.h"
16 class GrCircleBlurFragmentProcessor : public GrFragmentProcessor {
17 public:
circleRect()18     const SkRect& circleRect() const { return fCircleRect; }
textureRadius()19     float textureRadius() const { return fTextureRadius; }
solidRadius()20     float solidRadius() const { return fSolidRadius; }
21 
22     static std::unique_ptr<GrFragmentProcessor> Make(GrProxyProvider*, const SkRect& circle,
23                                                      float sigma);
24     GrCircleBlurFragmentProcessor(const GrCircleBlurFragmentProcessor& src);
25     std::unique_ptr<GrFragmentProcessor> clone() const override;
name()26     const char* name() const override { return "CircleBlurFragmentProcessor"; }
27 
28 private:
GrCircleBlurFragmentProcessor(SkRect circleRect,float textureRadius,float solidRadius,sk_sp<GrTextureProxy> blurProfileSampler)29     GrCircleBlurFragmentProcessor(SkRect circleRect, float textureRadius, float solidRadius,
30                                   sk_sp<GrTextureProxy> blurProfileSampler)
31             : INHERITED(kGrCircleBlurFragmentProcessor_ClassID,
32                         (OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag)
33             , fCircleRect(circleRect)
34             , fTextureRadius(textureRadius)
35             , fSolidRadius(solidRadius)
36             , fBlurProfileSampler(std::move(blurProfileSampler)) {
37         this->setTextureSamplerCnt(1);
38     }
39     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
40     void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
41     bool onIsEqual(const GrFragmentProcessor&) const override;
42     const TextureSampler& onTextureSampler(int) const override;
43     GR_DECLARE_FRAGMENT_PROCESSOR_TEST
44     SkRect fCircleRect;
45     float fTextureRadius;
46     float fSolidRadius;
47     TextureSampler fBlurProfileSampler;
48     typedef GrFragmentProcessor INHERITED;
49 };
50 #endif
51