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