aboutsummaryrefslogtreecommitdiffhomepage
path: root/gpu/src/GrGpuGLShaders.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-10 13:52:42 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-10 13:52:42 +0000
commitcc4dac3dac215dc0dd56f7b30d07cc304671b033 (patch)
treedf2541be704a4c8db625028013a15aa763362336 /gpu/src/GrGpuGLShaders.cpp
parentee9aa304579b3d5314519372728187879456d49d (diff)
Make GrMatrix an alias of SkMatrix. Add new methods to SkMatrix.
Review URL: http://codereview.appspot.com/4538043/ Checked in on behalf of reed@ with some additional work (remove the do-nother sk->gr matrix converter). git-svn-id: http://skia.googlecode.com/svn/trunk@1289 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src/GrGpuGLShaders.cpp')
-rw-r--r--gpu/src/GrGpuGLShaders.cpp39
1 files changed, 20 insertions, 19 deletions
diff --git a/gpu/src/GrGpuGLShaders.cpp b/gpu/src/GrGpuGLShaders.cpp
index c2b89716de..3ce6e55d69 100644
--- a/gpu/src/GrGpuGLShaders.cpp
+++ b/gpu/src/GrGpuGLShaders.cpp
@@ -273,7 +273,8 @@ void GrGpuGLShaders::resetContext() {
void GrGpuGLShaders::flushViewMatrix() {
GrAssert(NULL != fCurrDrawState.fRenderTarget);
- GrMatrix m (
+ GrMatrix m;
+ m.setAll(
GrIntToScalar(2) / fCurrDrawState.fRenderTarget->width(), 0, -GR_Scalar1,
0,-GrIntToScalar(2) / fCurrDrawState.fRenderTarget->height(), GR_Scalar1,
0, 0, GrMatrix::I()[8]);
@@ -282,15 +283,15 @@ void GrGpuGLShaders::flushViewMatrix() {
// ES doesn't allow you to pass true to the transpose param,
// so do our own transpose
GrScalar mt[] = {
- m[GrMatrix::kScaleX],
- m[GrMatrix::kSkewY],
- m[GrMatrix::kPersp0],
- m[GrMatrix::kSkewX],
- m[GrMatrix::kScaleY],
- m[GrMatrix::kPersp1],
- m[GrMatrix::kTransX],
- m[GrMatrix::kTransY],
- m[GrMatrix::kPersp2]
+ m[GrMatrix::kMScaleX],
+ m[GrMatrix::kMSkewY],
+ m[GrMatrix::kMPersp0],
+ m[GrMatrix::kMSkewX],
+ m[GrMatrix::kMScaleY],
+ m[GrMatrix::kMPersp1],
+ m[GrMatrix::kMTransX],
+ m[GrMatrix::kMTransY],
+ m[GrMatrix::kMPersp2]
};
if (GrGLProgram::kSetAsAttribute ==
@@ -327,15 +328,15 @@ void GrGpuGLShaders::flushTextureMatrix(int s) {
// ES doesn't allow you to pass true to the transpose param,
// so do our own transpose
GrScalar mt[] = {
- m[GrMatrix::kScaleX],
- m[GrMatrix::kSkewY],
- m[GrMatrix::kPersp0],
- m[GrMatrix::kSkewX],
- m[GrMatrix::kScaleY],
- m[GrMatrix::kPersp1],
- m[GrMatrix::kTransX],
- m[GrMatrix::kTransY],
- m[GrMatrix::kPersp2]
+ m[GrMatrix::kMScaleX],
+ m[GrMatrix::kMSkewY],
+ m[GrMatrix::kMPersp0],
+ m[GrMatrix::kMSkewX],
+ m[GrMatrix::kMScaleY],
+ m[GrMatrix::kMPersp1],
+ m[GrMatrix::kMTransX],
+ m[GrMatrix::kMTransY],
+ m[GrMatrix::kMPersp2]
};
if (GrGLProgram::kSetAsAttribute ==
fProgramData->fUniLocations.fStages[s].fTextureMatrixUni) {