mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 885621. Fix gfxPattern::GetMatrix() with azure and add GetInverseMatrix(). r=bas
Currently SetMatrix will take the Inverse of the passed in matrix but GetMatrix doesn't not invert it on the way out. This fixes that and adds a GetInverseMatrix() so that we don't double invert it when we need the inverse. --HG-- extra : rebase_source : 6bb2049ccee22c62b1825687ecd09ddd1aad8b2e
This commit is contained in:
parent
30d6de5fab
commit
971ac55d18
@ -1431,8 +1431,7 @@ gfxContext::Mask(gfxPattern *pattern)
|
||||
}
|
||||
|
||||
if (needsClip) {
|
||||
Matrix mat = ToMatrix(pattern->GetMatrix());
|
||||
mat.Invert();
|
||||
Matrix mat = ToMatrix(pattern->GetInverseMatrix());
|
||||
mat = mat * GetDTTransform();
|
||||
|
||||
mDT->SetTransform(mat);
|
||||
|
@ -122,6 +122,23 @@ gfxPattern::GetMatrix() const
|
||||
cairo_matrix_t mat;
|
||||
cairo_pattern_get_matrix(mPattern, &mat);
|
||||
return gfxMatrix(*reinterpret_cast<gfxMatrix*>(&mat));
|
||||
} else {
|
||||
// invert at the higher precision of gfxMatrix
|
||||
// cause we need to convert at some point anyways
|
||||
gfxMatrix mat = ThebesMatrix(mTransform);
|
||||
mat.Invert();
|
||||
return mat;
|
||||
}
|
||||
}
|
||||
|
||||
gfxMatrix
|
||||
gfxPattern::GetInverseMatrix() const
|
||||
{
|
||||
if (mPattern) {
|
||||
cairo_matrix_t mat;
|
||||
cairo_pattern_get_matrix(mPattern, &mat);
|
||||
cairo_matrix_invert(&mat);
|
||||
return gfxMatrix(*reinterpret_cast<gfxMatrix*>(&mat));
|
||||
} else {
|
||||
return ThebesMatrix(mTransform);
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
|
||||
void SetMatrix(const gfxMatrix& matrix);
|
||||
gfxMatrix GetMatrix() const;
|
||||
gfxMatrix GetInverseMatrix() const;
|
||||
|
||||
/* Get an Azure Pattern for the current Cairo pattern. aPattern transform
|
||||
* specifies the transform that was set on the DrawTarget when the pattern
|
||||
|
Loading…
Reference in New Issue
Block a user