1
2
3 /**************************************************************************************************
4 *** This file was autogenerated from GrNonInlinedInUniform.fp; do not modify.
5 **************************************************************************************************/
6 #include "GrNonInlinedInUniform.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 GrGLSLNonInlinedInUniform : public GrGLSLFragmentProcessor {
16 public:
GrGLSLNonInlinedInUniform()17 GrGLSLNonInlinedInUniform() {}
emitCode(EmitArgs & args)18 void emitCode(EmitArgs& args) override {
19 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
20 const GrNonInlinedInUniform& _outer = args.fFp.cast<GrNonInlinedInUniform>();
21 (void) _outer;
22 auto point = _outer.point;
23 (void) point;
24 pointVar = args.fUniformHandler->addUniform(&_outer, kFragment_GrShaderFlag, kHalf2_GrSLType, "point");
25 fragBuilder->codeAppendf(
26 R"SkSL(return half4(%s, %s);
27 )SkSL"
28 , args.fUniformHandler->getUniformCStr(pointVar), args.fUniformHandler->getUniformCStr(pointVar));
29 }
30 private:
onSetData(const GrGLSLProgramDataManager & pdman,const GrFragmentProcessor & _proc)31 void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
32 const GrNonInlinedInUniform& _outer = _proc.cast<GrNonInlinedInUniform>();
33 {
34 const SkPoint& pointValue = _outer.point;
35 pdman.set2f(pointVar, pointValue.fX, pointValue.fY);
36 }
37 }
38 UniformHandle pointVar;
39 };
onMakeProgramImpl() const40 std::unique_ptr<GrGLSLFragmentProcessor> GrNonInlinedInUniform::onMakeProgramImpl() const {
41 return std::make_unique<GrGLSLNonInlinedInUniform>();
42 }
onGetGLSLProcessorKey(const GrShaderCaps & caps,GrProcessorKeyBuilder * b) const43 void GrNonInlinedInUniform::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
44 }
onIsEqual(const GrFragmentProcessor & other) const45 bool GrNonInlinedInUniform::onIsEqual(const GrFragmentProcessor& other) const {
46 const GrNonInlinedInUniform& that = other.cast<GrNonInlinedInUniform>();
47 (void) that;
48 if (point != that.point) return false;
49 return true;
50 }
GrNonInlinedInUniform(const GrNonInlinedInUniform & src)51 GrNonInlinedInUniform::GrNonInlinedInUniform(const GrNonInlinedInUniform& src)
52 : INHERITED(kGrNonInlinedInUniform_ClassID, src.optimizationFlags())
53 , point(src.point) {
54 this->cloneAndRegisterAllChildProcessors(src);
55 }
clone() const56 std::unique_ptr<GrFragmentProcessor> GrNonInlinedInUniform::clone() const {
57 return std::make_unique<GrNonInlinedInUniform>(*this);
58 }
59 #if GR_TEST_UTILS
onDumpInfo() const60 SkString GrNonInlinedInUniform::onDumpInfo() const {
61 return SkStringPrintf("(point=half2(%f, %f))", point.fX, point.fY);
62 }
63 #endif
64