• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 
3 /**************************************************************************************************
4  *** This file was autogenerated from GrInlinedFunction.fp; do not modify.
5  **************************************************************************************************/
6 #include "GrInlinedFunction.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 GrGLSLInlinedFunction : public GrGLSLFragmentProcessor {
16 public:
GrGLSLInlinedFunction()17     GrGLSLInlinedFunction() {}
emitCode(EmitArgs & args)18     void emitCode(EmitArgs& args) override {
19         GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
20         const GrInlinedFunction& _outer = args.fFp.cast<GrInlinedFunction>();
21         (void) _outer;
22         colorVar = args.fUniformHandler->addUniform(&_outer, kFragment_GrShaderFlag, kHalf4_GrSLType, "color");
23         fragBuilder->codeAppendf(
24 R"SkSL(return %s.wzyx;
25 
26 )SkSL"
27 , args.fUniformHandler->getUniformCStr(colorVar));
28     }
29 private:
onSetData(const GrGLSLProgramDataManager & pdman,const GrFragmentProcessor & _proc)30     void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
31     }
32     UniformHandle colorVar;
33 };
onMakeProgramImpl() const34 std::unique_ptr<GrGLSLFragmentProcessor> GrInlinedFunction::onMakeProgramImpl() const {
35     return std::make_unique<GrGLSLInlinedFunction>();
36 }
onGetGLSLProcessorKey(const GrShaderCaps & caps,GrProcessorKeyBuilder * b) const37 void GrInlinedFunction::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
38 }
onIsEqual(const GrFragmentProcessor & other) const39 bool GrInlinedFunction::onIsEqual(const GrFragmentProcessor& other) const {
40     const GrInlinedFunction& that = other.cast<GrInlinedFunction>();
41     (void) that;
42     return true;
43 }
GrInlinedFunction(const GrInlinedFunction & src)44 GrInlinedFunction::GrInlinedFunction(const GrInlinedFunction& src)
45 : INHERITED(kGrInlinedFunction_ClassID, src.optimizationFlags()) {
46         this->cloneAndRegisterAllChildProcessors(src);
47 }
clone() const48 std::unique_ptr<GrFragmentProcessor> GrInlinedFunction::clone() const {
49     return std::make_unique<GrInlinedFunction>(*this);
50 }
51 #if GR_TEST_UTILS
onDumpInfo() const52 SkString GrInlinedFunction::onDumpInfo() const {
53     return SkString();
54 }
55 #endif
56