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

Unified Diff: src/gpu/gl/GrGLProgram.cpp

Issue 299943002: separate view matrix from rt adjustment (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase on tot: Created 6 years, 7 months 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/gl/GrGLProgram.h ('k') | src/gpu/gl/GrGLShaderBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgram.cpp
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index aa46aedae001c4eca3a54c783ee8264ddb79aa6d..efd6e4606b4cf113e99c9221f61fc5e9f7048bbf 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -52,6 +52,7 @@ GrGLProgram::GrGLProgram(GrGpuGL* gpu,
GrGLFullShaderBuilder fullBuilder(fGpu, fUniformManager, fDesc);
if (this->genProgram(&fullBuilder, colorStages, coverageStages)) {
fUniformHandles.fViewMatrixUni = fullBuilder.getViewMatrixUniform();
+ fUniformHandles.fRTAdjustmentUni = fullBuilder.getRTAdjustmentVecUniform();
fHasVertexShader = true;
}
} else {
@@ -329,6 +330,7 @@ void GrGLProgram::setMatrixAndRenderTargetHeight(const GrDrawState& drawState) {
if (!fHasVertexShader) {
SkASSERT(!fUniformHandles.fViewMatrixUni.isValid());
+ SkASSERT(!fUniformHandles.fRTAdjustmentUni.isValid());
fGpu->setProjectionMatrix(drawState.getViewMatrix(), size, rt->origin());
} else if (fMatrixState.fRenderTargetOrigin != rt->origin() ||
fMatrixState.fRenderTargetSize != size ||
@@ -342,5 +344,9 @@ void GrGLProgram::setMatrixAndRenderTargetHeight(const GrDrawState& drawState) {
GrGLfloat viewMatrix[3 * 3];
fMatrixState.getGLMatrix<3>(viewMatrix);
fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, viewMatrix);
+
+ GrGLfloat rtAdjustmentVec[4];
+ fMatrixState.getRTAdjustmentVec(rtAdjustmentVec);
+ fUniformManager.set4fv(fUniformHandles.fRTAdjustmentUni, 1, rtAdjustmentVec);
}
}
« no previous file with comments | « src/gpu/gl/GrGLProgram.h ('k') | src/gpu/gl/GrGLShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698