Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: src/gpu/glsl/GrGLSLProgramBuilder.cpp

Issue 1490283004: Create GLSLUniformHandler class for gpu backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up public api of uniformhandler Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.h ('k') | src/gpu/glsl/GrGLSLShaderBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLProgramBuilder.cpp
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
index 54e82b30c0a4c01638ae927ad6dfa5ff34ccea24..d3ed719fdc573d3d9b7ca50975db73fab0a761fe 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
@@ -34,6 +34,27 @@ void GrGLSLProgramBuilder::nameVariable(SkString* out, char prefix, const char*
void GrGLSLProgramBuilder::appendUniformDecls(ShaderVisibility visibility,
SkString* out) const {
- this->onAppendUniformDecls(visibility, out);
+ this->uniformHandler()->appendUniformDecls(visibility, out);
+}
+
+void GrGLSLProgramBuilder::addRTAdjustmentUniform(GrSLPrecision precision,
+ const char* name,
+ const char** outName) {
+ SkASSERT(!fUniformHandles.fRTAdjustmentUni.isValid());
+ fUniformHandles.fRTAdjustmentUni =
+ this->uniformHandler()->addUniform(GrGLSLUniformHandler::kVertex_Visibility,
+ kVec4f_GrSLType,
+ precision,
+ name,
+ outName);
+}
+
+void GrGLSLProgramBuilder::addRTHeightUniform(const char* name, const char** outName) {
+ SkASSERT(!fUniformHandles.fRTHeightUni.isValid());
+ GrGLSLUniformHandler* uniformHandler = this->uniformHandler();
+ fUniformHandles.fRTHeightUni =
+ uniformHandler->internalAddUniformArray(GrGLSLUniformHandler::kFragment_Visibility,
+ kFloat_GrSLType, kDefault_GrSLPrecision,
+ name, false, 0, outName);
}
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.h ('k') | src/gpu/glsl/GrGLSLShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698