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

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: feedback inc 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
« no previous file with comments | « src/gpu/GrDefaultGeoProcFactory.cpp ('k') | src/gpu/GrOptDrawState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « src/gpu/GrDefaultGeoProcFactory.cpp ('k') | src/gpu/GrOptDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698