diff --git a/gfx/2d/Matrix.cpp b/gfx/2d/Matrix.cpp index b7bd9abb9ca..70058fede1e 100644 --- a/gfx/2d/Matrix.cpp +++ b/gfx/2d/Matrix.cpp @@ -6,6 +6,7 @@ #include "Matrix.h" #include "Tools.h" #include +#include #include #include "mozilla/FloatingPoint.h" // for UnspecifiedNaN @@ -15,6 +16,18 @@ using namespace std; namespace mozilla { namespace gfx { +std::ostream& +operator<<(std::ostream& aStream, const Matrix& aMatrix) +{ + return aStream << "[ " << aMatrix._11 + << " " << aMatrix._12 + << "; " << aMatrix._21 + << " " << aMatrix._22 + << "; " << aMatrix._31 + << " " << aMatrix._32 + << "; ]"; +} + Matrix Matrix::Rotation(Float aAngle) { diff --git a/gfx/2d/Matrix.h b/gfx/2d/Matrix.h index c331dbb9c46..11dd2412b1b 100644 --- a/gfx/2d/Matrix.h +++ b/gfx/2d/Matrix.h @@ -9,6 +9,7 @@ #include "Types.h" #include "Rect.h" #include "Point.h" +#include #include #include "mozilla/Attributes.h" #include "mozilla/DebugOnly.h" @@ -43,6 +44,8 @@ public: return Matrix(*this); } + friend std::ostream& operator<<(std::ostream& aStream, const Matrix& aMatrix); + Point operator *(const Point &aPoint) const { Point retPoint;