Bug 1120609 - Printing support for gfx::Matrix. r=Bas

--HG--
extra : rebase_source : 38e46208c14df09dc49c73c7fddfc3b5534efd4c
This commit is contained in:
Botond Ballo 2015-01-19 11:29:16 -05:00
parent c120f78b00
commit c888ca7137
2 changed files with 16 additions and 0 deletions

View File

@ -6,6 +6,7 @@
#include "Matrix.h"
#include "Tools.h"
#include <algorithm>
#include <ostream>
#include <math.h>
#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)
{

View File

@ -9,6 +9,7 @@
#include "Types.h"
#include "Rect.h"
#include "Point.h"
#include <iosfwd>
#include <math.h>
#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;