1
2
3 /**************************************************************************************************
4 *** This file was autogenerated from GrChildProcessorSampleCoords.fp; do not modify.
5 **************************************************************************************************/
6 #include "GrChildProcessorSampleCoords.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 GrGLSLChildProcessorSampleCoords : public GrGLSLFragmentProcessor {
16 public:
GrGLSLChildProcessorSampleCoords()17 GrGLSLChildProcessorSampleCoords() {}
emitCode(EmitArgs & args)18 void emitCode(EmitArgs& args) override {
19 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
20 const GrChildProcessorSampleCoords& _outer = args.fFp.cast<GrChildProcessorSampleCoords>();
21 (void) _outer;
22 SkString _sample0 = this->invokeChild(0, args);
23 SkString _coords1 = SkStringPrintf("%s / 2.0", args.fSampleCoord);
24 SkString _sample1 = this->invokeChild(0, args, _coords1.c_str());
25 fragBuilder->codeAppendf(
26 R"SkSL(return %s + %s;
27 )SkSL"
28 , _sample0.c_str(), _sample1.c_str());
29 }
30 private:
onSetData(const GrGLSLProgramDataManager & pdman,const GrFragmentProcessor & _proc)31 void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
32 }
33 };
onMakeProgramImpl() const34 std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorSampleCoords::onMakeProgramImpl() const {
35 return std::make_unique<GrGLSLChildProcessorSampleCoords>();
36 }
onGetGLSLProcessorKey(const GrShaderCaps & caps,GrProcessorKeyBuilder * b) const37 void GrChildProcessorSampleCoords::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
38 }
onIsEqual(const GrFragmentProcessor & other) const39 bool GrChildProcessorSampleCoords::onIsEqual(const GrFragmentProcessor& other) const {
40 const GrChildProcessorSampleCoords& that = other.cast<GrChildProcessorSampleCoords>();
41 (void) that;
42 return true;
43 }
GrChildProcessorSampleCoords(const GrChildProcessorSampleCoords & src)44 GrChildProcessorSampleCoords::GrChildProcessorSampleCoords(const GrChildProcessorSampleCoords& src)
45 : INHERITED(kGrChildProcessorSampleCoords_ClassID, src.optimizationFlags()) {
46 this->cloneAndRegisterAllChildProcessors(src);
47 this->setUsesSampleCoordsDirectly();
48 }
clone() const49 std::unique_ptr<GrFragmentProcessor> GrChildProcessorSampleCoords::clone() const {
50 return std::make_unique<GrChildProcessorSampleCoords>(*this);
51 }
52 #if GR_TEST_UTILS
onDumpInfo() const53 SkString GrChildProcessorSampleCoords::onDumpInfo() const {
54 return SkString();
55 }
56 #endif
57