Bug 1082483, part 1 - Rename Matrix4x4::Translate/Scale to Matrix4x4::PreTranslate/PreScale, leaving temporary inlines for the old names. r=Bas
authorJonathan Watt <jwatt@jwatt.org>
Thu, 16 Oct 2014 10:51:12 +0100
changeset 210698 cd0e534e1012260eed00da1b4c1820a6569bafcc
parent 210697 4de60ee2e647747aa958fbf844be3711eab21efa
child 210699 0f5c20e2b2c2275e7623e6eb8a7af17b0f3428a3
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersBas
bugs1082483
milestone36.0a1
Bug 1082483, part 1 - Rename Matrix4x4::Translate/Scale to Matrix4x4::PreTranslate/PreScale, leaving temporary inlines for the old names. r=Bas
gfx/2d/Matrix.h
--- a/gfx/2d/Matrix.h
+++ b/gfx/2d/Matrix.h
@@ -553,25 +553,29 @@ public:
    *   Matrix4x4::Translation(x, y) * this
    *
    * (Note that in performance critical code multiplying by the result of a
    * Translation()/Scaling() call is not recommended since that results in a
    * full matrix multiply involving 64 floating-point multiplications. Calling
    * this method would be preferred since it only involves 12 floating-point
    * multiplications.)
    */
-  Matrix4x4 &Translate(Float aX, Float aY, Float aZ)
+  Matrix4x4 &PreTranslate(Float aX, Float aY, Float aZ)
   {
     _41 += aX * _11 + aY * _21 + aZ * _31;
     _42 += aX * _12 + aY * _22 + aZ * _32;
     _43 += aX * _13 + aY * _23 + aZ * _33;
     _44 += aX * _14 + aY * _24 + aZ * _34;
 
     return *this;
   }
+  Matrix4x4 &Translate(Float aX, Float aY, Float aZ)
+  {
+    return PreTranslate(aX, aY, aZ);
+  }
 
   /**
    * Similar to PreTranslate, but the translation is applied -after- this
    * matrix's existing transformation instead of before it.
    *
    * This method is generally less used than PreTranslate since typically code
    * wants to adjust an existing user space to device space matrix to create a
    * transform to device space from a -new- user space (translated from the
@@ -604,30 +608,34 @@ public:
                      0.0f, aScaleY, 0.0f, 0.0f,
                      0.0f, 0.0f, aScaleZ, 0.0f,
                      0.0f, 0.0f, 0.0f, 1.0f);
   }
 
   /**
    * Similar to PreTranslate, but applies a scale instead of a translation.
    */
-  Matrix4x4 &Scale(Float aX, Float aY, Float aZ)
+  Matrix4x4 &PreScale(Float aX, Float aY, Float aZ)
   {
     _11 *= aX;
     _12 *= aX;
     _13 *= aX;
     _21 *= aY;
     _22 *= aY;
     _23 *= aY;
     _31 *= aZ;
     _32 *= aZ;
     _33 *= aZ;
 
     return *this;
   }
+  Matrix4x4 &Scale(Float aX, Float aY, Float aZ)
+  {
+    return PreScale(aX, aY, aZ);
+  }
 
   /**
    * Similar to PostTranslate, but applies a scale instead of a translation.
    */
   Matrix4x4 &PostScale(Float aScaleX, Float aScaleY, Float aScaleZ)
   {
     _11 *= aScaleX;
     _21 *= aScaleX;
@@ -658,17 +666,17 @@ public:
   void SkewYZ(Float aSkew)
   {
       (*this)[2] += (*this)[1] * aSkew;
   }
 
   Matrix4x4 &ChangeBasis(Float aX, Float aY, Float aZ)
   {
     // Translate to the origin before applying this matrix
-    Translate(-aX, -aY, -aZ);
+    PreTranslate(-aX, -aY, -aZ);
 
     // Translate back into position after applying this matrix
     PostTranslate(aX, aY, aZ);
 
     return *this;
   }
 
   bool operator==(const Matrix4x4& o) const