Bug 1055661 - Add Matrix5x4::operator== which does exact equality comparison. f=Milan, r=Bas
authorMarkus Stange <mstange@themasta.com>
Tue, 02 Sep 2014 14:05:49 +0200
changeset 202979 c412208c484102629b65d5ef17b5af77ac124d54
parent 202978 c98b1e8ca69a2ced2e5175044b185270882bdeb7
child 202980 4a969a77fd3190f14f8a178a929732f9ff209ca6
push id48541
push usermstange@themasta.com
push dateTue, 02 Sep 2014 12:11:36 +0000
treeherdermozilla-inbound@3591d6e79035 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs1055661
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 1055661 - Add Matrix5x4::operator== which does exact equality comparison. f=Milan, r=Bas
gfx/2d/Matrix.h
--- a/gfx/2d/Matrix.h
+++ b/gfx/2d/Matrix.h
@@ -745,16 +745,30 @@ public:
          Float a51, Float a52, Float a53, Float a54)
     : _11(a11), _12(a12), _13(a13), _14(a14)
     , _21(a21), _22(a22), _23(a23), _24(a24)
     , _31(a31), _32(a32), _33(a33), _34(a34)
     , _41(a41), _42(a42), _43(a43), _44(a44)
     , _51(a51), _52(a52), _53(a53), _54(a54)
   {}
 
+  bool operator==(const Matrix5x4 &o) const
+  {
+    return _11 == o._11 && _12 == o._12 && _13 == o._13 && _14 == o._14 &&
+           _21 == o._21 && _22 == o._22 && _23 == o._23 && _24 == o._24 &&
+           _31 == o._31 && _32 == o._32 && _33 == o._33 && _34 == o._34 &&
+           _41 == o._41 && _42 == o._42 && _43 == o._43 && _44 == o._44 &&
+           _51 == o._51 && _52 == o._52 && _53 == o._53 && _54 == o._54;
+  }
+
+  bool operator!=(const Matrix5x4 &aMatrix) const
+  {
+    return !(*this == aMatrix);
+  }
+
   Matrix5x4 operator*(const Matrix5x4 &aMatrix) const
   {
     Matrix5x4 resultMatrix;
 
     resultMatrix._11 = this->_11 * aMatrix._11 + this->_12 * aMatrix._21 + this->_13 * aMatrix._31 + this->_14 * aMatrix._41;
     resultMatrix._12 = this->_11 * aMatrix._12 + this->_12 * aMatrix._22 + this->_13 * aMatrix._32 + this->_14 * aMatrix._42;
     resultMatrix._13 = this->_11 * aMatrix._13 + this->_12 * aMatrix._23 + this->_13 * aMatrix._33 + this->_14 * aMatrix._43;
     resultMatrix._14 = this->_11 * aMatrix._14 + this->_12 * aMatrix._24 + this->_13 * aMatrix._34 + this->_14 * aMatrix._44;