diff options
author | egdaniel <egdaniel@google.com> | 2015-12-03 09:20:44 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-03 09:20:44 -0800 |
commit | 7ea439b2203855db97330b25945b87dd4b170b8b (patch) | |
tree | c64bdcbd415fc639ec8c4fb791846cac80ff6f44 /src/core | |
parent | 73063dc517f424ad5660db0fbc5fe6fcc13f77f7 (diff) |
Create GLSLUniformHandler class for gpu backend
BUG=skia:
Review URL: https://codereview.chromium.org/1490283004
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkLightingShader.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp index 147a7ef915..a9fcac3b83 100644 --- a/src/core/SkLightingShader.cpp +++ b/src/core/SkLightingShader.cpp @@ -129,11 +129,12 @@ private: #include "GrCoordTransform.h" #include "GrFragmentProcessor.h" +#include "GrInvariantOutput.h" #include "GrTextureAccess.h" #include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" -#include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" +#include "glsl/GrGLSLUniformHandler.h" #include "SkGr.h" #include "SkGrPriv.h" @@ -180,27 +181,28 @@ public: void emitCode(EmitArgs& args) override { GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; + GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; // add uniforms const char* lightDirUniName = nullptr; - fLightDirUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, - kVec3f_GrSLType, kDefault_GrSLPrecision, - "LightDir", &lightDirUniName); + fLightDirUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, + kVec3f_GrSLType, kDefault_GrSLPrecision, + "LightDir", &lightDirUniName); const char* lightColorUniName = nullptr; - fLightColorUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, - kVec3f_GrSLType, kDefault_GrSLPrecision, - "LightColor", &lightColorUniName); + fLightColorUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, + kVec3f_GrSLType, kDefault_GrSLPrecision, + "LightColor", &lightColorUniName); const char* ambientColorUniName = nullptr; - fAmbientColorUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, - kVec3f_GrSLType, kDefault_GrSLPrecision, - "AmbientColor", &ambientColorUniName); + fAmbientColorUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, + kVec3f_GrSLType, kDefault_GrSLPrecision, + "AmbientColor", &ambientColorUniName); const char* xformUniName = nullptr; - fXformUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, - kVec2f_GrSLType, kDefault_GrSLPrecision, - "Xform", &xformUniName); + fXformUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, + kVec2f_GrSLType, kDefault_GrSLPrecision, + "Xform", &xformUniName); fragBuilder->codeAppend("vec4 diffuseColor = "); fragBuilder->appendTextureLookupAndModulate(args.fInputColor, args.fSamplers[0], |