Index: src/gpu/glsl/GrGLSLGeometryProcessor.cpp |
diff --git a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp |
index 8a1e81a1f8ee400bc1ff15df4eb9d915d93d258a..a8bd8ac4f82b14f9757e42465b0cf5aff0498e3e 100644 |
--- a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp |
+++ b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp |
@@ -7,9 +7,10 @@ |
#include "GrGLSLGeometryProcessor.h" |
+#include "GrCoordTransform.h" |
#include "glsl/GrGLSLFragmentShaderBuilder.h" |
#include "glsl/GrGLSLProcessorTypes.h" |
-#include "glsl/GrGLSLProgramBuilder.h" |
+#include "glsl/GrGLSLUniformHandler.h" |
#include "glsl/GrGLSLVarying.h" |
#include "glsl/GrGLSLVertexShaderBuilder.h" |
@@ -20,9 +21,9 @@ void GrGLSLGeometryProcessor::emitCode(EmitArgs& args) { |
vBuilder->transformToNormalizedDeviceSpace(gpArgs.fPositionVar); |
} |
-void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb, |
- GrGLSLVertexBuilder* vb, |
+void GrGLSLGeometryProcessor::emitTransforms(GrGLSLVertexBuilder* vb, |
GrGLSLVaryingHandler* varyingHandler, |
+ GrGLSLUniformHandler* uniformHandler, |
const GrShaderVar& posVar, |
const char* localCoords, |
const SkMatrix& localMatrix, |
@@ -49,10 +50,10 @@ void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb, |
const char* uniName; |
fInstalledTransforms[i][t].fHandle = |
- pb->addUniform(GrGLSLProgramBuilder::kVertex_Visibility, |
- kMat33f_GrSLType, precision, |
- strUniName.c_str(), |
- &uniName).toIndex(); |
+ uniformHandler->addUniform(GrGLSLUniformHandler::kVertex_Visibility, |
+ kMat33f_GrSLType, precision, |
+ strUniName.c_str(), |
+ &uniName).toIndex(); |
SkString strVaryingName("MatrixCoord"); |
strVaryingName.appendf("_%i_%i", i, t); |
@@ -94,8 +95,7 @@ void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb, |
} |
} |
-void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb, |
- GrGLSLVertexBuilder* vb, |
+void GrGLSLGeometryProcessor::emitTransforms(GrGLSLVertexBuilder* vb, |
GrGLSLVaryingHandler* varyingHandler, |
const char* localCoords, |
const TransformsIn& tin, |
@@ -124,16 +124,15 @@ void GrGLSLGeometryProcessor::emitTransforms(GrGLSLGPBuilder* pb, |
} |
} |
-void GrGLSLGeometryProcessor::setupPosition(GrGLSLGPBuilder* pb, |
- GrGLSLVertexBuilder* vertBuilder, |
+void GrGLSLGeometryProcessor::setupPosition(GrGLSLVertexBuilder* vertBuilder, |
GrGPArgs* gpArgs, |
const char* posName) { |
gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2"); |
vertBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName); |
} |
-void GrGLSLGeometryProcessor::setupPosition(GrGLSLGPBuilder* pb, |
- GrGLSLVertexBuilder* vertBuilder, |
+void GrGLSLGeometryProcessor::setupPosition(GrGLSLVertexBuilder* vertBuilder, |
+ GrGLSLUniformHandler* uniformHandler, |
GrGPArgs* gpArgs, |
const char* posName, |
const SkMatrix& mat, |
@@ -143,10 +142,10 @@ void GrGLSLGeometryProcessor::setupPosition(GrGLSLGPBuilder* pb, |
vertBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName); |
} else { |
const char* viewMatrixName; |
- *viewMatrixUniform = pb->addUniform(GrGLSLProgramBuilder::kVertex_Visibility, |
- kMat33f_GrSLType, kHigh_GrSLPrecision, |
- "uViewM", |
- &viewMatrixName); |
+ *viewMatrixUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kVertex_Visibility, |
+ kMat33f_GrSLType, kHigh_GrSLPrecision, |
+ "uViewM", |
+ &viewMatrixName); |
if (!mat.hasPerspective()) { |
gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2"); |
vertBuilder->codeAppendf("vec2 %s = vec2(%s * vec3(%s, 1));", |