bug 743767 - fix bugs in pattern matrix handling in GlyphBufferAzure. r=bas

This commit is contained in:
Jonathan Kew 2012-04-10 11:57:23 +01:00
parent 9862b7600f
commit ad4dfaa901

View File

@ -1500,24 +1500,25 @@ struct GlyphBufferAzure {
if (invFontMatrix) {
// The brush matrix needs to be multiplied with the inverted matrix
// as well, to move the brush into the space of the glyphs. Before
// the render target transformation
// as well, to move the brush into the space of the glyphs. Before
// the render target transformation
// This relies on the returned Pattern not to be reused by
// others, but regenerated on GetPattern calls. This is true!
Matrix *mat;
Matrix *mat = nsnull;
if (pat->GetType() == PATTERN_LINEAR_GRADIENT) {
mat = &static_cast<LinearGradientPattern*>(pat)->mMatrix;
} else if (pat->GetType() == PATTERN_RADIAL_GRADIENT) {
mat = &static_cast<LinearGradientPattern*>(pat)->mMatrix;
mat = &static_cast<RadialGradientPattern*>(pat)->mMatrix;
} else if (pat->GetType() == PATTERN_SURFACE) {
mat = &static_cast<LinearGradientPattern*>(pat)->mMatrix;
mat = &static_cast<SurfacePattern*>(pat)->mMatrix;
}
*mat = (*mat) * (*invFontMatrix);
if (mat) {
*mat = (*mat) * (*invFontMatrix);
}
}
aDT->FillGlyphs(aFont, buf, *pat,
DrawOptions(), aOptions);
} else if (state.sourceSurface) {