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
diff --git a/gpu/src/GrContext.cpp b/gpu/src/GrContext.cpp
index 8461187..2d93e4b 100644
--- a/gpu/src/GrContext.cpp
+++ b/gpu/src/GrContext.cpp
@@ -925,7 +925,7 @@
             GrVec strokeSize;;
             if (width > 0) {
                 strokeSize.set(width, width);
-                combinedMatrix.mapVec(&strokeSize);
+                combinedMatrix.mapVectors(&strokeSize, 1);
                 strokeSize.setAbs(strokeSize);
             } else {
                 strokeSize.set(GR_Scalar1, GR_Scalar1);
diff --git a/gpu/src/GrGpuGLFixed.cpp b/gpu/src/GrGpuGLFixed.cpp
index dbfac43..e197a82 100644
--- a/gpu/src/GrGpuGLFixed.cpp
+++ b/gpu/src/GrGpuGLFixed.cpp
@@ -32,17 +32,17 @@
 
     void set(const GrMatrix& m) {
         Gr_bzero(fMat, sizeof(fMat));
-        fMat[0]  = GrScalarToFloat(m[GrMatrix::kScaleX]);
-        fMat[4]  = GrScalarToFloat(m[GrMatrix::kSkewX]);
-        fMat[12] = GrScalarToFloat(m[GrMatrix::kTransX]);
+        fMat[0]  = GrScalarToFloat(m[GrMatrix::kMScaleX]);
+        fMat[4]  = GrScalarToFloat(m[GrMatrix::kMSkewX]);
+        fMat[12] = GrScalarToFloat(m[GrMatrix::kMTransX]);
 
-        fMat[1]  = GrScalarToFloat(m[GrMatrix::kSkewY]);
-        fMat[5]  = GrScalarToFloat(m[GrMatrix::kScaleY]);
-        fMat[13] = GrScalarToFloat(m[GrMatrix::kTransY]);
+        fMat[1]  = GrScalarToFloat(m[GrMatrix::kMSkewY]);
+        fMat[5]  = GrScalarToFloat(m[GrMatrix::kMScaleY]);
+        fMat[13] = GrScalarToFloat(m[GrMatrix::kMTransY]);
 
-        fMat[3]  = GrScalarToFloat(m[GrMatrix::kPersp0]);
-        fMat[7]  = GrScalarToFloat(m[GrMatrix::kPersp1]);
-        fMat[15] = GrScalarToFloat(m[GrMatrix::kPersp2]);
+        fMat[3]  = GrScalarToFloat(m[GrMatrix::kMPersp0]);
+        fMat[7]  = GrScalarToFloat(m[GrMatrix::kMPersp1]);
+        fMat[15] = GrScalarToFloat(m[GrMatrix::kMPersp2]);
 
         fMat[10] = 1.f;    // z-scale
     }
diff --git a/gpu/src/GrGpuGLShaders.cpp b/gpu/src/GrGpuGLShaders.cpp
index c2b8971..3ce6e55 100644
--- a/gpu/src/GrGpuGLShaders.cpp
+++ b/gpu/src/GrGpuGLShaders.cpp
@@ -273,7 +273,8 @@
 
 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 @@
     // 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 @@
             // 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) {
diff --git a/gpu/src/GrMatrix.cpp b/gpu/src/GrMatrix.cpp
index c88c6e1..476d9a2 100644
--- a/gpu/src/GrMatrix.cpp
+++ b/gpu/src/GrMatrix.cpp
@@ -19,6 +19,7 @@
 #include "GrRect.h"
 #include <stddef.h>
 
+#if 0
 #if GR_SCALAR_IS_FLOAT
     const GrScalar GrMatrix::gRESCALE(GR_Scalar1);
 #else
@@ -688,6 +689,7 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
+#endif
 
 int Gr_clz(uint32_t n) {
     if (0 == n) {
@@ -716,4 +718,3 @@
     }
     return count;
 }
-
diff --git a/gpu/src/gr_unittests.cpp b/gpu/src/gr_unittests.cpp
index fd27f19..320dd15 100644
--- a/gpu/src/gr_unittests.cpp
+++ b/gpu/src/gr_unittests.cpp
@@ -152,7 +152,6 @@
     test_tdarray();
     test_bsearch();
     test_binHashKey();
-    GrMatrix::UnitTest();
     GrRedBlackTree<int>::UnitTest();
     GrPath::ConvexUnitTest();
     GrDrawTarget::VertexLayoutUnitTest();