Bug 1058048 - Implement the *= operator on Matrix4x4. r=Bas
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 26 Aug 2014 12:04:07 -0400
changeset 201681 a1a9fb5f37adb6b0449b84ac1dd3a3db95dbcbbe
parent 201680 f53a9fd07563c8b9217b6ac3dc984d68bb8de2ec
child 201682 f3f888ce457240a17b8e4352a8fbe11ba305d610
push id27375
push userryanvm@gmail.com
push dateTue, 26 Aug 2014 19:56:59 +0000
treeherdermozilla-central@f9bfe115fee5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs1058048
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1058048 - Implement the *= operator on Matrix4x4. r=Bas
gfx/2d/Matrix.h
--- a/gfx/2d/Matrix.h
+++ b/gfx/2d/Matrix.h
@@ -529,16 +529,21 @@ public:
     matrix._14 = _11 * aMatrix._14 + _12 * aMatrix._24 + _13 * aMatrix._34 + _14 * aMatrix._44;
     matrix._24 = _21 * aMatrix._14 + _22 * aMatrix._24 + _23 * aMatrix._34 + _24 * aMatrix._44;
     matrix._34 = _31 * aMatrix._14 + _32 * aMatrix._24 + _33 * aMatrix._34 + _34 * aMatrix._44;
     matrix._44 = _41 * aMatrix._14 + _42 * aMatrix._24 + _43 * aMatrix._34 + _44 * aMatrix._44;
 
     return matrix;
   }
 
+  Matrix4x4& operator*=(const Matrix4x4 &aMatrix)
+  {
+    Matrix4x4 resultMatrix = *this * aMatrix;
+    return *this = resultMatrix;
+  }
 
   /* Returns true if the matrix is an identity matrix.
    */
   bool IsIdentity() const
   {
     return _11 == 1.0f && _12 == 0.0f && _13 == 0.0f && _14 == 0.0f &&
            _21 == 0.0f && _22 == 1.0f && _23 == 0.0f && _24 == 0.0f &&
            _31 == 0.0f && _32 == 0.0f && _33 == 1.0f && _34 == 0.0f &&