bug 744480 - check for failure to set up the cairo font. r=bas
authorJonathan Kew <jfkthame@gmail.com>
Fri, 13 Apr 2012 17:39:39 +0100
changeset 94934 2f77fddb6f7ab61eff575cb7861bed8d8664808c
parent 94933 843a8a7b54c5586c6051e692982e50162848eaef
child 94935 a11fba8ea615e51d9accd35d5423e46fc6e2e620
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas
bugs744480
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 744480 - check for failure to set up the cairo font. r=bas
gfx/thebes/gfxGDIFont.cpp
--- a/gfx/thebes/gfxGDIFont.cpp
+++ b/gfx/thebes/gfxGDIFont.cpp
@@ -151,19 +151,23 @@ gfxGDIFont::ShapeWord(gfxContext *aConte
     }
     if (!mIsValid) {
         NS_WARNING("invalid font! expect incorrect text rendering");
         return false;
     }
 
     bool ok = false;
 
-    // ensure the cairo font is set up, so there's no risk it'll fall back to
-    // creating a "toy" font internally (see bug 544617)
-    SetupCairoFont(aContext);
+    // Ensure the cairo font is set up, so there's no risk it'll fall back to
+    // creating a "toy" font internally (see bug 544617).
+    // We must check that this succeeded, otherwise we risk cairo creating the
+    // wrong kind of font internally as a fallback (bug 744480).
+    if (!SetupCairoFont(aContext)) {
+        return false;
+    }
 
 #ifdef MOZ_GRAPHITE
     if (mGraphiteShaper && gfxPlatform::GetPlatform()->UseGraphiteShaping()) {
         ok = mGraphiteShaper->ShapeWord(aContext, aShapedWord, aString);
     }
 #endif
 
     if (!ok && mHarfBuzzShaper) {