Index: src/gpu/GrGeometryProcessor.cpp |
diff --git a/src/gpu/GrGeometryProcessor.cpp b/src/gpu/GrGeometryProcessor.cpp |
index 01ea85a78b30d7db42124af5029727a9b474eb3a..6bd6b2b54badd963b3a5794e301476f2a1cb3d48 100644 |
--- a/src/gpu/GrGeometryProcessor.cpp |
+++ b/src/gpu/GrGeometryProcessor.cpp |
@@ -56,6 +56,25 @@ void GrGLGeometryProcessor::setupColorPassThrough(GrGLGPBuilder* pb, |
} |
} |
+void GrGLGeometryProcessor::addUniformViewMatrix(GrGLGPBuilder* pb) { |
+ fViewMatrixUniform = pb->addUniform(GrGLProgramBuilder::kVertex_Visibility, |
+ kMat33f_GrSLType, kDefault_GrSLPrecision, |
+ "uViewM", |
+ &fViewMatrixName); |
+} |
+ |
+void GrGLGeometryProcessor::setUniformViewMatrix(const GrGLProgramDataManager& pdman, |
+ const SkMatrix& viewMatrix) { |
+ if (!fViewMatrix.cheapEqualTo(viewMatrix)) { |
+ SkASSERT(fViewMatrixUniform.isValid()); |
+ fViewMatrix = viewMatrix; |
+ |
+ GrGLfloat viewMatrix[3 * 3]; |
+ GrGLGetMatrix<3>(viewMatrix, fViewMatrix); |
+ pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); |
+ } |
+} |
+ |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
struct PathBatchTracker { |