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 "include/core/SkTypes.h"
14#include "include/core/SkM44.h"
15
16#include "src/gpu/GrCoordTransform.h"
17#include "src/gpu/GrFragmentProcessor.h"
18class GrCircleEffect : public GrFragmentProcessor {
19public:
20 static std::unique_ptr<GrFragmentProcessor> Make(GrClipEdgeType edgeType,
21 SkPoint center,
22 float radius) {
23 // A radius below half causes the implicit insetting done by this processor to become
24 // inverted. We could handle this case by making the processor code more complicated.
25 if (radius < .5f && GrProcessorEdgeTypeIsInverseFill(edgeType)) {
26 return nullptr;
27 }
28 return std::unique_ptr<GrFragmentProcessor>(new GrCircleEffect(edgeType, center, radius));
29 }
30 GrCircleEffect(const GrCircleEffect& src);
31 std::unique_ptr<GrFragmentProcessor> clone() const override;
32 const char* name() const override { return "CircleEffect"; }
33 GrClipEdgeType edgeType;
34 SkPoint center;
35 float radius;
36
37private:
38 GrCircleEffect(GrClipEdgeType edgeType, SkPoint center, float radius)
39 : INHERITED(kGrCircleEffect_ClassID,
40 (OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag)
41 , edgeType(edgeType)
42 , center(center)
43 , radius(radius) {}
44 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
45 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
46 bool onIsEqual(const GrFragmentProcessor&) const override;
47 GR_DECLARE_FRAGMENT_PROCESSOR_TEST
48 typedef GrFragmentProcessor INHERITED;
49};
50#endif
51