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