From a1b1f3a56352d69493c45826a4c5ed1aac1e0d71 Mon Sep 17 00:00:00 2001 From: "vladimir@pobox.com" Date: Tue, 31 Jul 2007 13:34:43 -0700 Subject: [PATCH] b=390202, trunk topcrash gfxFont::Draw, r=stuart,a=damon --- gfx/thebes/src/gfxFont.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gfx/thebes/src/gfxFont.cpp b/gfx/thebes/src/gfxFont.cpp index 3602393568a4..5c9473ef5aec 100644 --- a/gfx/thebes/src/gfxFont.cpp +++ b/gfx/thebes/src/gfxFont.cpp @@ -166,11 +166,7 @@ gfxFont::gfxFont(const nsAString &aName, const gfxFontStyle *aFontStyle) : * A helper function in case we need to do any rounding or other * processing here. */ -static double -ToDeviceUnits(double aAppUnits, double aDevUnitsPerAppUnit) -{ - return aAppUnits*aDevUnitsPerAppUnit; -} +#define ToDeviceUnits(aAppUnits, aDevUnitsPerAppUnit) (double(aAppUnits)*double(aDevUnitsPerAppUnit)) struct GlyphBuffer { #define GLYPH_BUFFER_SIZE (2048/sizeof(cairo_glyph_t)) @@ -260,10 +256,12 @@ gfxFont::Draw(gfxTextRun *aTextRun, PRUint32 aStart, PRUint32 aEnd, glyph->x -= ToDeviceUnits(advance, devUnitsPerAppUnit); } x += direction*advance; + + glyphs.Flush(cr, aDrawToPath); + if (details->mIsLastGlyph) break; ++details; - glyphs.Flush(cr, aDrawToPath); } } else if (glyphData->IsMissing()) { const gfxTextRun::DetailedGlyph *details = aTextRun->GetDetailedGlyphs(i);