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

Unified Diff: src/gpu/GrGeometryProcessor.cpp

Issue 827973002: ViewMatrix uniform upload moved to GeometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@vm-on-gp
Patch Set: more cleanup Created 6 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
Index: src/gpu/GrGeometryProcessor.cpp
diff --git a/src/gpu/GrGeometryProcessor.cpp b/src/gpu/GrGeometryProcessor.cpp
index 01ea85a78b30d7db42124af5029727a9b474eb3a..b1400670f10c76d0162e15957a4593486e7ab498 100644
--- a/src/gpu/GrGeometryProcessor.cpp
+++ b/src/gpu/GrGeometryProcessor.cpp
@@ -56,6 +56,25 @@ void GrGLGeometryProcessor::setupColorPassThrough(GrGLGPBuilder* pb,
}
}
+void GrGLGeometryProcessor::setupUniformViewMatrix(GrGLGPBuilder* pb) {
bsalomon 2014/12/30 13:19:38 These functions are so similarly named. Maybe we c
+ 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 {

Powered by Google App Engine
This is Rietveld 408576698