mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1025553, part 4 - Add some missing Moz2D Matrix API to gfxMatrix. r=Bas
This commit is contained in:
parent
7645116817
commit
a63faceba7
@ -58,6 +58,22 @@ gfxMatrix::PreMultiply(const gfxMatrix& m)
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* static */ gfxMatrix
|
||||
gfxMatrix::Rotation(gfxFloat aAngle)
|
||||
{
|
||||
gfxMatrix newMatrix;
|
||||
|
||||
gfxFloat s = sin(aAngle);
|
||||
gfxFloat c = cos(aAngle);
|
||||
|
||||
newMatrix._11 = c;
|
||||
newMatrix._12 = s;
|
||||
newMatrix._21 = -s;
|
||||
newMatrix._22 = c;
|
||||
|
||||
return newMatrix;
|
||||
}
|
||||
|
||||
gfxPoint
|
||||
gfxMatrix::Transform(const gfxPoint& point) const
|
||||
{
|
||||
|
@ -144,6 +144,23 @@ public:
|
||||
*/
|
||||
const gfxMatrix& PreMultiply(const gfxMatrix& m);
|
||||
|
||||
static gfxMatrix Translation(gfxFloat aX, gfxFloat aY)
|
||||
{
|
||||
return gfxMatrix(1.0, 0.0, 0.0, 1.0, aX, aY);
|
||||
}
|
||||
|
||||
static gfxMatrix Translation(gfxPoint aPoint)
|
||||
{
|
||||
return Translation(aPoint.x, aPoint.y);
|
||||
}
|
||||
|
||||
static gfxMatrix Rotation(gfxFloat aAngle);
|
||||
|
||||
static gfxMatrix Scaling(gfxFloat aX, gfxFloat aY)
|
||||
{
|
||||
return gfxMatrix(aX, 0.0, 0.0, aY, 0.0, 0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms a point according to this matrix.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user