зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1065718 - Make gfxMatrix's Translate(), Scale() and Rotate() methods return a non-const reference. r=Bas
This commit is contained in:
Родитель
358c1f203e
Коммит
d1a93f6238
|
@ -23,21 +23,21 @@ gfxMatrix::Invert()
|
|||
return cairo_matrix_invert(CAIRO_MATRIX(this)) == CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
const gfxMatrix&
|
||||
gfxMatrix&
|
||||
gfxMatrix::Scale(gfxFloat x, gfxFloat y)
|
||||
{
|
||||
cairo_matrix_scale(CAIRO_MATRIX(this), x, y);
|
||||
return *this;
|
||||
}
|
||||
|
||||
const gfxMatrix&
|
||||
gfxMatrix&
|
||||
gfxMatrix::Translate(const gfxPoint& pt)
|
||||
{
|
||||
cairo_matrix_translate(CAIRO_MATRIX(this), pt.x, pt.y);
|
||||
return *this;
|
||||
}
|
||||
|
||||
const gfxMatrix&
|
||||
gfxMatrix&
|
||||
gfxMatrix::Rotate(gfxFloat radians)
|
||||
{
|
||||
cairo_matrix_rotate(CAIRO_MATRIX(this), radians);
|
||||
|
@ -51,7 +51,7 @@ gfxMatrix::operator *= (const gfxMatrix& m)
|
|||
return *this;
|
||||
}
|
||||
|
||||
const gfxMatrix&
|
||||
gfxMatrix&
|
||||
gfxMatrix::PreMultiply(const gfxMatrix& m)
|
||||
{
|
||||
cairo_matrix_multiply(CAIRO_MATRIX(this), CONST_CAIRO_MATRIX(&m), CAIRO_MATRIX(this));
|
||||
|
|
|
@ -127,13 +127,17 @@ public:
|
|||
* Scales this matrix. The scale is pre-multiplied onto this matrix,
|
||||
* i.e. the scaling takes place before the other transformations.
|
||||
*/
|
||||
const gfxMatrix& Scale(gfxFloat x, gfxFloat y);
|
||||
gfxMatrix& Scale(gfxFloat x, gfxFloat y);
|
||||
|
||||
/**
|
||||
* Translates this matrix. The translation is pre-multiplied onto this matrix,
|
||||
* i.e. the translation takes place before the other transformations.
|
||||
*/
|
||||
const gfxMatrix& Translate(const gfxPoint& pt);
|
||||
gfxMatrix& Translate(const gfxPoint& pt);
|
||||
|
||||
gfxMatrix& Translate(gfxFloat x, gfxFloat y) {
|
||||
return Translate(gfxPoint(x, y));
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotates this matrix. The rotation is pre-multiplied onto this matrix,
|
||||
|
@ -141,14 +145,14 @@ public:
|
|||
*
|
||||
* @param radians Angle in radians.
|
||||
*/
|
||||
const gfxMatrix& Rotate(gfxFloat radians);
|
||||
gfxMatrix& Rotate(gfxFloat radians);
|
||||
|
||||
/**
|
||||
* Multiplies the current matrix with m.
|
||||
* This is a pre-multiplication, i.e. the transformations of m are
|
||||
* applied _before_ the existing transformations.
|
||||
*/
|
||||
const gfxMatrix& PreMultiply(const gfxMatrix& m);
|
||||
gfxMatrix& PreMultiply(const gfxMatrix& m);
|
||||
|
||||
static gfxMatrix Translation(gfxFloat aX, gfxFloat aY)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче