Create GLSLUniformHandler class for gpu backend
BUG=skia:
Review URL: https://codereview.chromium.org/1490283004
diff --git a/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp b/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp
index 70b58cd..23bb249 100644
--- a/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp
@@ -7,8 +7,10 @@
#include "GrGLSLPrimitiveProcessor.h"
-#include "glsl/GrGLSLProgramBuilder.h"
+#include "GrCoordTransform.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLUniformHandler.h"
+#include "glsl/GrGLSLVertexShaderBuilder.h"
SkMatrix GrGLSLPrimitiveProcessor::GetTransformMatrix(const SkMatrix& localMatrix,
const GrCoordTransform& coordTransform) {
@@ -32,16 +34,16 @@
return combined;
}
-void GrGLSLPrimitiveProcessor::setupUniformColor(GrGLSLGPBuilder* pb,
- GrGLSLFragmentBuilder* fragBuilder,
+void GrGLSLPrimitiveProcessor::setupUniformColor(GrGLSLFragmentBuilder* fragBuilder,
+ GrGLSLUniformHandler* uniformHandler,
const char* outputName,
UniformHandle* colorUniform) {
SkASSERT(colorUniform);
const char* stagedLocalVarName;
- *colorUniform = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
- kVec4f_GrSLType,
- kDefault_GrSLPrecision,
- "Color",
- &stagedLocalVarName);
+ *colorUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
+ kVec4f_GrSLType,
+ kDefault_GrSLPrecision,
+ "Color",
+ &stagedLocalVarName);
fragBuilder->codeAppendf("%s = %s;", outputName, stagedLocalVarName);
}