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