Backed out changeset 91d8ca122eda (bug 1553889) for bugs/513153-2a.html failures CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Mon, 27 May 2019 23:59:08 +0300
changeset 475772 46eeb92b85f858a4ed49cc25a779faef723dc09f
parent 475771 c37c85af0fb0baad7fa25a177f2db8bcafbf6dc4
child 475788 92582acb077d723e32adbda4d368e4a8cca34876
push id86472
push userbtara@mozilla.com
push dateMon, 27 May 2019 20:59:29 +0000
treeherderautoland@46eeb92b85f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1553889, 513153
milestone69.0a1
backs out91d8ca122edaf8e547b832f6e7f06e32cb13523a
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
Backed out changeset 91d8ca122eda (bug 1553889) for bugs/513153-2a.html failures CLOSED TREE
gfx/thebes/gfxMacFont.cpp
--- a/gfx/thebes/gfxMacFont.cpp
+++ b/gfx/thebes/gfxMacFont.cpp
@@ -190,54 +190,51 @@ bool gfxMacFont::ShapeText(DrawTarget* a
                            uint32_t aOffset, uint32_t aLength, Script aScript,
                            bool aVertical, RoundingFlags aRounding,
                            gfxShapedText* aShapedText) {
   if (!mIsValid) {
     NS_WARNING("invalid font! expect incorrect text rendering");
     return false;
   }
 
-  bool ok = false;
-
   // Currently, we don't support vertical shaping via CoreText,
   // so we ignore RequiresAATLayout if vertical is requested.
   auto macFontEntry = static_cast<MacOSFontEntry*>(GetFontEntry());
   if (macFontEntry->RequiresAATLayout() && !aVertical &&
       StaticPrefs::CoreTextEnabled()) {
     if (!mCoreTextShaper) {
       mCoreTextShaper = MakeUnique<gfxCoreTextShaper>(this);
     }
-    ok = mCoreTextShaper->ShapeText(aDrawTarget, aText, aOffset, aLength,
-                                    aScript, aVertical, aRounding, aShapedText);
-    if (ok) {
+    if (mCoreTextShaper->ShapeText(aDrawTarget, aText, aOffset, aLength,
+                                   aScript, aVertical, aRounding,
+                                   aShapedText)) {
       PostShapingFixup(aDrawTarget, aText, aOffset, aLength, aVertical,
                        aShapedText);
+
+      if (macFontEntry->HasTrackingTable()) {
+        // Convert font size from device pixels back to CSS px
+        // to use in selecting tracking value
+        float trackSize = GetAdjustedSize() *
+                          aShapedText->GetAppUnitsPerDevUnit() /
+                          AppUnitsPerCSSPixel();
+        float tracking =
+            macFontEntry->TrackingForCSSPx(trackSize) * mFUnitsConvFactor;
+        // Applying tracking is a lot like the adjustment we do for
+        // synthetic bold: we want to apply between clusters, not to
+        // non-spacing glyphs within a cluster. So we can reuse that
+        // helper here.
+        aShapedText->AdjustAdvancesForSyntheticBold(tracking, aOffset, aLength);
+      }
+
+      return true;
     }
   }
 
-  if (!ok) {
-    ok = gfxFont::ShapeText(aDrawTarget, aText, aOffset, aLength, aScript,
+  return gfxFont::ShapeText(aDrawTarget, aText, aOffset, aLength, aScript,
                             aVertical, aRounding, aShapedText);
-  }
-
-  if (ok && macFontEntry->HasTrackingTable()) {
-    // Convert font size from device pixels back to CSS px
-    // to use in selecting tracking value
-    float trackSize = GetAdjustedSize() * aShapedText->GetAppUnitsPerDevUnit() /
-                      AppUnitsPerCSSPixel();
-    float tracking =
-        macFontEntry->TrackingForCSSPx(trackSize) * mFUnitsConvFactor;
-    // Applying tracking is a lot like the adjustment we do for
-    // synthetic bold: we want to apply between clusters, not to
-    // non-spacing glyphs within a cluster. So we can reuse that
-    // helper here.
-    aShapedText->AdjustAdvancesForSyntheticBold(tracking, aOffset, aLength);
-  }
-
-  return ok;
 }
 
 bool gfxMacFont::SetupCairoFont(DrawTarget* aDrawTarget) {
   if (cairo_scaled_font_status(mScaledFont) != CAIRO_STATUS_SUCCESS) {
     // Don't cairo_set_scaled_font as that would propagate the error to
     // the cairo_t, precluding any further drawing.
     return false;
   }