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

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

Issue 23767005: Add getGLMatrix method to MatrixState (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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
Index: src/gpu/gl/GrGLProgram.cpp
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index d457a32c4e4e8a213b4e9cb030cb647207b9c7f9..ac9794d4d5d3f5994cfcb427ae3293c839ff5f3f 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -980,35 +980,13 @@ void GrGLProgram::setMatrixAndRenderTargetHeight(const GrDrawState& drawState) {
if (fMatrixState.fRenderTargetOrigin != rt->origin() ||
!fMatrixState.fViewMatrix.cheapEqualTo(drawState.getViewMatrix()) ||
fMatrixState.fRenderTargetSize != size) {
- SkMatrix m;
- if (kBottomLeft_GrSurfaceOrigin == rt->origin()) {
- m.setAll(
- SkIntToScalar(2) / size.fWidth, 0, -SK_Scalar1,
- 0,-SkIntToScalar(2) / size.fHeight, SK_Scalar1,
- 0, 0, SkMatrix::I()[8]);
- } else {
- m.setAll(
- SkIntToScalar(2) / size.fWidth, 0, -SK_Scalar1,
- 0, SkIntToScalar(2) / size.fHeight,-SK_Scalar1,
- 0, 0, SkMatrix::I()[8]);
- }
- m.setConcat(m, drawState.getViewMatrix());
-
- // ES doesn't allow you to pass true to the transpose param so we do our own transpose.
- GrGLfloat mt[] = {
- SkScalarToFloat(m[SkMatrix::kMScaleX]),
- SkScalarToFloat(m[SkMatrix::kMSkewY]),
- SkScalarToFloat(m[SkMatrix::kMPersp0]),
- SkScalarToFloat(m[SkMatrix::kMSkewX]),
- SkScalarToFloat(m[SkMatrix::kMScaleY]),
- SkScalarToFloat(m[SkMatrix::kMPersp1]),
- SkScalarToFloat(m[SkMatrix::kMTransX]),
- SkScalarToFloat(m[SkMatrix::kMTransY]),
- SkScalarToFloat(m[SkMatrix::kMPersp2])
- };
- fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, mt);
+
fMatrixState.fViewMatrix = drawState.getViewMatrix();
fMatrixState.fRenderTargetSize = size;
fMatrixState.fRenderTargetOrigin = rt->origin();
+
+ GrGLfloat viewMatrix[3 * 3];
+ fMatrixState.getGLMatrix<3>(viewMatrix);
+ fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, viewMatrix);
}
}
« no previous file with comments | « src/gpu/gl/GrGLProgram.h ('k') | src/gpu/gl/GrGLUtil.h » ('j') | src/gpu/gl/GrGpuGL_program.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698