From a85cf16773329d59a4a3bbbe47b601a71b285fd3 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Tue, 10 Apr 2012 11:57:23 +0100 Subject: [PATCH] bug 743767 - fix bugs in pattern matrix handling in GlyphBufferAzure. r=bas --- gfx/thebes/gfxFont.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index be9dfeab53c..88f0eaf9e5a 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -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(pat)->mMatrix; } else if (pat->GetType() == PATTERN_RADIAL_GRADIENT) { - mat = &static_cast(pat)->mMatrix; + mat = &static_cast(pat)->mMatrix; } else if (pat->GetType() == PATTERN_SURFACE) { - mat = &static_cast(pat)->mMatrix; + mat = &static_cast(pat)->mMatrix; } - *mat = (*mat) * (*invFontMatrix); + if (mat) { + *mat = (*mat) * (*invFontMatrix); + } } - aDT->FillGlyphs(aFont, buf, *pat, DrawOptions(), aOptions); } else if (state.sourceSurface) {