1 2 3 /************************************************************************************************** 4 *** This file was autogenerated from GrSectionEmitCode.fp; do not modify. 5 **************************************************************************************************/ 6 #include "GrSectionEmitCode.h" 7 8 #include "src/core/SkUtils.h" 9 #include "src/gpu/GrTexture.h" 10 #include "src/gpu/glsl/GrGLSLFragmentProcessor.h" 11 #include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h" 12 #include "src/gpu/glsl/GrGLSLProgramBuilder.h" 13 #include "src/sksl/SkSLCPP.h" 14 #include "src/sksl/SkSLUtil.h" 15 class GrGLSLSectionEmitCode : public GrGLSLFragmentProcessor { 16 public: GrGLSLSectionEmitCode()17 GrGLSLSectionEmitCode() {} emitCode(EmitArgs & args)18 void emitCode(EmitArgs& args) override { 19 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; 20 const GrSectionEmitCode& _outer = args.fFp.cast<GrSectionEmitCode>(); 21 (void) _outer; 22 x = 10.0; 23 fragBuilder->codeAppendf("half y = %d\n", x * 2); fragBuilder->codeAppendf( 24 R"SkSL(half x = %f; 25 return half4(1.0); 26 )SkSL" 27 , x); 28 } 29 private: onSetData(const GrGLSLProgramDataManager & pdman,const GrFragmentProcessor & _proc)30 void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override { 31 } 32 float x = 0; 33 }; onMakeProgramImpl() const34std::unique_ptr<GrGLSLFragmentProcessor> GrSectionEmitCode::onMakeProgramImpl() const { 35 return std::make_unique<GrGLSLSectionEmitCode>(); 36 } onGetGLSLProcessorKey(const GrShaderCaps & caps,GrProcessorKeyBuilder * b) const37void GrSectionEmitCode::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const { 38 } onIsEqual(const GrFragmentProcessor & other) const39bool GrSectionEmitCode::onIsEqual(const GrFragmentProcessor& other) const { 40 const GrSectionEmitCode& that = other.cast<GrSectionEmitCode>(); 41 (void) that; 42 return true; 43 } GrSectionEmitCode(const GrSectionEmitCode & src)44GrSectionEmitCode::GrSectionEmitCode(const GrSectionEmitCode& src) 45 : INHERITED(kGrSectionEmitCode_ClassID, src.optimizationFlags()) { 46 this->cloneAndRegisterAllChildProcessors(src); 47 } clone() const48std::unique_ptr<GrFragmentProcessor> GrSectionEmitCode::clone() const { 49 return std::make_unique<GrSectionEmitCode>(*this); 50 } 51 #if GR_TEST_UTILS onDumpInfo() const52SkString GrSectionEmitCode::onDumpInfo() const { 53 return SkString(); 54 } 55 #endif 56