1 /* 2 * Copyright 2020 Google LLC 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 GrDeviceSpaceEffect.fp; do not modify. 10 **************************************************************************************************/ 11 #ifndef GrDeviceSpaceEffect_DEFINED 12 #define GrDeviceSpaceEffect_DEFINED 13 14 #include "include/core/SkM44.h" 15 #include "include/core/SkTypes.h" 16 17 #include "src/gpu/GrFragmentProcessor.h" 18 19 class GrDeviceSpaceEffect : public GrFragmentProcessor { 20 public: constantOutputForConstantInput(const SkPMColor4f & inColor)21 SkPMColor4f constantOutputForConstantInput(const SkPMColor4f& inColor) const override { 22 return ConstantOutputForConstantInput(this->childProcessor(0), inColor); 23 } 24 Make(std::unique_ptr<GrFragmentProcessor> fp)25 static std::unique_ptr<GrFragmentProcessor> Make(std::unique_ptr<GrFragmentProcessor> fp) { 26 return std::unique_ptr<GrFragmentProcessor>(new GrDeviceSpaceEffect(std::move(fp))); 27 } 28 GrDeviceSpaceEffect(const GrDeviceSpaceEffect& src); 29 std::unique_ptr<GrFragmentProcessor> clone() const override; name()30 const char* name() const override { return "DeviceSpaceEffect"; } 31 32 private: GrDeviceSpaceEffect(std::unique_ptr<GrFragmentProcessor> fp)33 GrDeviceSpaceEffect(std::unique_ptr<GrFragmentProcessor> fp) 34 : INHERITED(kGrDeviceSpaceEffect_ClassID, 35 (OptimizationFlags)ProcessorOptimizationFlags(fp.get())) { 36 this->registerChild(std::move(fp), SkSL::SampleUsage::Explicit()); 37 } 38 std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override; 39 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; 40 bool onIsEqual(const GrFragmentProcessor&) const override; 41 #if GR_TEST_UTILS 42 SkString onDumpInfo() const override; 43 #endif 44 GR_DECLARE_FRAGMENT_PROCESSOR_TEST 45 using INHERITED = GrFragmentProcessor; 46 }; 47 #endif 48