1 /*#pragma settings NoInline*/
2
3 /**************************************************************************************************
4 *** This file was autogenerated from GrNestedCall.fp; do not modify.
5 **************************************************************************************************/
6 #include "GrNestedCall.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 GrGLSLNestedCall : public GrGLSLFragmentProcessor {
16 public:
GrGLSLNestedCall()17 GrGLSLNestedCall() {}
emitCode(EmitArgs & args)18 void emitCode(EmitArgs& args) override {
19 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
20 const GrNestedCall& _outer = args.fFp.cast<GrNestedCall>();
21 (void) _outer;
22 SkString func1_name = fragBuilder->getMangledFunctionName("func1");
23 const GrShaderVar func1_args[] = { };
24 SkString func2_name = fragBuilder->getMangledFunctionName("func2");
25 const GrShaderVar func2_args[] = { };
26 SkString func3_name = fragBuilder->getMangledFunctionName("func3");
27 const GrShaderVar func3_args[] = { };
28 fragBuilder->emitFunctionPrototype(kHalf4_GrSLType, func1_name.c_str(), {func1_args, 0});
29 fragBuilder->emitFunctionPrototype(kHalf4_GrSLType, func2_name.c_str(), {func2_args, 0});
30 fragBuilder->emitFunctionPrototype(kHalf4_GrSLType, func3_name.c_str(), {func3_args, 0});
31 const String func1_impl = String::printf(R"SkSL(return %s();
32 )SkSL"
33 , func2_name.c_str());
34 fragBuilder->emitFunction(kHalf4_GrSLType, func1_name.c_str(), {func1_args, 0}, func1_impl.c_str());
35 const String func2_impl = String::printf(R"SkSL(return %s();
36 )SkSL"
37 , func3_name.c_str());
38 fragBuilder->emitFunction(kHalf4_GrSLType, func2_name.c_str(), {func2_args, 0}, func2_impl.c_str());
39 fragBuilder->codeAppendf(
40 R"SkSL(return %s();
41 )SkSL"
42 , func1_name.c_str());
43 }
44 private:
onSetData(const GrGLSLProgramDataManager & pdman,const GrFragmentProcessor & _proc)45 void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
46 }
47 };
onMakeProgramImpl() const48 std::unique_ptr<GrGLSLFragmentProcessor> GrNestedCall::onMakeProgramImpl() const {
49 return std::make_unique<GrGLSLNestedCall>();
50 }
onGetGLSLProcessorKey(const GrShaderCaps & caps,GrProcessorKeyBuilder * b) const51 void GrNestedCall::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
52 }
onIsEqual(const GrFragmentProcessor & other) const53 bool GrNestedCall::onIsEqual(const GrFragmentProcessor& other) const {
54 const GrNestedCall& that = other.cast<GrNestedCall>();
55 (void) that;
56 return true;
57 }
GrNestedCall(const GrNestedCall & src)58 GrNestedCall::GrNestedCall(const GrNestedCall& src)
59 : INHERITED(kGrNestedCall_ClassID, src.optimizationFlags()) {
60 this->cloneAndRegisterAllChildProcessors(src);
61 }
clone() const62 std::unique_ptr<GrFragmentProcessor> GrNestedCall::clone() const {
63 return std::make_unique<GrNestedCall>(*this);
64 }
65 #if GR_TEST_UTILS
onDumpInfo() const66 SkString GrNestedCall::onDumpInfo() const {
67 return SkString();
68 }
69 #endif
70