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 GrAARectEffect.fp; do not modify. 10 **************************************************************************************************/ 11 #ifndef GrAARectEffect_DEFINED 12 #define GrAARectEffect_DEFINED 13 14 #include "include/core/SkM44.h" 15 #include "include/core/SkTypes.h" 16 17 #include "src/gpu/GrFragmentProcessor.h" 18 19 class GrAARectEffect : public GrFragmentProcessor { 20 public: Make(std::unique_ptr<GrFragmentProcessor> inputFP,GrClipEdgeType edgeType,SkRect rect)21 static std::unique_ptr<GrFragmentProcessor> Make(std::unique_ptr<GrFragmentProcessor> inputFP, 22 GrClipEdgeType edgeType, 23 SkRect rect) { 24 return std::unique_ptr<GrFragmentProcessor>( 25 new GrAARectEffect(std::move(inputFP), edgeType, rect)); 26 } 27 GrAARectEffect(const GrAARectEffect& src); 28 std::unique_ptr<GrFragmentProcessor> clone() const override; name()29 const char* name() const override { return "AARectEffect"; } 30 GrClipEdgeType edgeType; 31 SkRect rect; 32 33 private: GrAARectEffect(std::unique_ptr<GrFragmentProcessor> inputFP,GrClipEdgeType edgeType,SkRect rect)34 GrAARectEffect(std::unique_ptr<GrFragmentProcessor> inputFP, 35 GrClipEdgeType edgeType, 36 SkRect rect) 37 : INHERITED(kGrAARectEffect_ClassID, 38 (OptimizationFlags)ProcessorOptimizationFlags(inputFP.get()) & 39 kCompatibleWithCoverageAsAlpha_OptimizationFlag) 40 , edgeType(edgeType) 41 , rect(rect) { 42 this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough()); 43 } 44 std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override; 45 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; 46 bool onIsEqual(const GrFragmentProcessor&) const override; 47 #if GR_TEST_UTILS 48 SkString onDumpInfo() const override; 49 #endif 50 GR_DECLARE_FRAGMENT_PROCESSOR_TEST 51 using INHERITED = GrFragmentProcessor; 52 }; 53 #endif 54