1 
2 
3 /**************************************************************************************************
4  *** This file was autogenerated from GrChildProcessorsWithInput.fp; do not modify.
5  **************************************************************************************************/
6 #include "GrChildProcessorsWithInput.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 GrGLSLChildProcessorsWithInput : public GrGLSLFragmentProcessor {
16 public:
GrGLSLChildProcessorsWithInput()17     GrGLSLChildProcessorsWithInput() {}
emitCode(EmitArgs & args)18     void emitCode(EmitArgs& args) override {
19         GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
20         const GrChildProcessorsWithInput& _outer = args.fFp.cast<GrChildProcessorsWithInput>();
21         (void) _outer;
22         colorVar = args.fUniformHandler->addUniform(&_outer, kFragment_GrShaderFlag, kHalf4_GrSLType, "color");
23         fragBuilder->codeAppendf(
24 R"SkSL(half4 childIn = %s;)SkSL"
25 , args.fUniformHandler->getUniformCStr(colorVar));
26         SkString _input0("childIn");
27         SkString _sample0 = this->invokeChild(0, _input0.c_str(), args);
28         fragBuilder->codeAppendf(
29 R"SkSL(
30 half4 childOut1 = %s;)SkSL"
31 , _sample0.c_str());
32         SkString _input1("childOut1");
33         SkString _sample1 = this->invokeChild(1, _input1.c_str(), args);
34         fragBuilder->codeAppendf(
35 R"SkSL(
36 half4 childOut2 = %s;
37 return childOut2;
38 )SkSL"
39 , _sample1.c_str());
40     }
41 private:
onSetData(const GrGLSLProgramDataManager & pdman,const GrFragmentProcessor & _proc)42     void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
43     }
44     UniformHandle colorVar;
45 };
onMakeProgramImpl() const46 std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorsWithInput::onMakeProgramImpl() const {
47     return std::make_unique<GrGLSLChildProcessorsWithInput>();
48 }
onGetGLSLProcessorKey(const GrShaderCaps & caps,GrProcessorKeyBuilder * b) const49 void GrChildProcessorsWithInput::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
50 }
onIsEqual(const GrFragmentProcessor & other) const51 bool GrChildProcessorsWithInput::onIsEqual(const GrFragmentProcessor& other) const {
52     const GrChildProcessorsWithInput& that = other.cast<GrChildProcessorsWithInput>();
53     (void) that;
54     return true;
55 }
GrChildProcessorsWithInput(const GrChildProcessorsWithInput & src)56 GrChildProcessorsWithInput::GrChildProcessorsWithInput(const GrChildProcessorsWithInput& src)
57 : INHERITED(kGrChildProcessorsWithInput_ClassID, src.optimizationFlags()) {
58         this->cloneAndRegisterAllChildProcessors(src);
59 }
clone() const60 std::unique_ptr<GrFragmentProcessor> GrChildProcessorsWithInput::clone() const {
61     return std::make_unique<GrChildProcessorsWithInput>(*this);
62 }
63 #if GR_TEST_UTILS
onDumpInfo() const64 SkString GrChildProcessorsWithInput::onDumpInfo() const {
65     return SkString();
66 }
67 #endif
68