Bug 634734 - "Fennec ASSERTION: mFUnitsConvFactor not valid: 'mFUnitsConvFactor > 0.0f" [r=karlt a-2.0=pavlov]
authorDoug Turner <doug.turner>
Wed, 16 Feb 2011 15:46:00 -0800
changeset 62775 9eacc33dd8f2ef8671c74478324864adad9aa63e
parent 62774 ebc51d671b3983eb28412d4b81e3f1ab96e00191
child 62776 039b9f95368f6fafaddd70e754f7ad8a5cdbf3d8
push idunknown
push userunknown
push dateunknown
reviewerskarlt
bugs634734
milestone2.0b12pre
Bug 634734 - "Fennec ASSERTION: mFUnitsConvFactor not valid: 'mFUnitsConvFactor > 0.0f" [r=karlt a-2.0=pavlov]
gfx/thebes/gfxFT2Fonts.cpp
--- a/gfx/thebes/gfxFT2Fonts.cpp
+++ b/gfx/thebes/gfxFT2Fonts.cpp
@@ -680,16 +680,24 @@ gfxFT2Font::InitTextRun(gfxContext *aCon
                         PRInt32 aRunScript,
                         PRBool aPreferPlatformShaping)
 {
     PRBool ok = PR_FALSE;
 
     if (gfxPlatform::GetPlatform()->UseHarfBuzzLevel() >=
         gfxUnicodeProperties::ScriptShapingLevel(aRunScript))
     {
+        if (!mHarfBuzzShaper) 
+        {
+            gfxFT2LockedFace face(this);
+            mFUnitsConvFactor = face.XScale();
+
+            mHarfBuzzShaper = new gfxHarfBuzzShaper(this);
+
+        }
         ok = mHarfBuzzShaper->InitTextRun(aContext, aTextRun, aString,
                                           aRunStart, aRunLength, aRunScript);
     }
 
     if (!ok) {
         AddRange(aTextRun, aString, aRunStart, aRunLength);
     }
 
@@ -798,18 +806,16 @@ gfxFT2Font::AddRange(gfxTextRun *aTextRu
 gfxFT2Font::gfxFT2Font(cairo_scaled_font_t *aCairoFont,
                        FontEntry *aFontEntry,
                        const gfxFontStyle *aFontStyle)
     : gfxFT2FontBase(aCairoFont, aFontEntry, aFontStyle)
 {
     NS_ASSERTION(mFontEntry, "Unable to find font entry for font.  Something is whack.");
 
     mCharGlyphCache.Init(64);
-
-    mHarfBuzzShaper = new gfxHarfBuzzShaper(this);
 }
 
 gfxFT2Font::~gfxFT2Font()
 {
 }
 
 cairo_font_face_t *
 gfxFT2Font::CairoFontFace()