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