Bug 1534693 - Bail out of font-family search in GlobalFontFallback once we've found a font with an exact style match. r=jwatt
☠☠ backed out by 0f2bb770f3ac ☠ ☠
authorJonathan Kew <jkew@mozilla.com>
Mon, 18 Mar 2019 16:28:19 +0000
changeset 464875 c78ae1f1f5386d4c978df4895478d3a7d9c1f5eb
parent 464874 f7a60828b0ad40b755c22b978ac85c6d1d7f00db
child 464876 36b4ae0fdc54e24397fd081afb812cf2a4de2c3c
push id35727
push userdvarga@mozilla.com
push dateTue, 19 Mar 2019 09:48:59 +0000
treeherdermozilla-central@70baa37ae1eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs1534693
milestone68.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 1534693 - Bail out of font-family search in GlobalFontFallback once we've found a font with an exact style match. r=jwatt Differential Revision: https://phabricator.services.mozilla.com/D23162
gfx/thebes/gfxPlatformFontList.cpp
layout/reftests/bidi/reftest.list
--- a/gfx/thebes/gfxPlatformFontList.cpp
+++ b/gfx/thebes/gfxPlatformFontList.cpp
@@ -674,16 +674,20 @@ gfxFontEntry* gfxPlatformFontList::Globa
   // otherwise, try to find it among local fonts
   GlobalFontMatch data(aCh, *aMatchStyle);
 
   // iterate over all font families to find a font that support the character
   for (auto iter = mFontFamilies.Iter(); !iter.Done(); iter.Next()) {
     RefPtr<gfxFontFamily>& family = iter.Data();
     // evaluate all fonts in this family for a match
     family->FindFontForChar(&data);
+    if (data.mMatchDistance == 0.0) {
+      // no better style match is possible, so stop searching
+      break;
+    }
   }
 
   aCmapCount = data.mCmapsTested;
   *aMatchedFamily = data.mMatchedFamily;
 
   return data.mBestMatch;
 }
 
--- a/layout/reftests/bidi/reftest.list
+++ b/layout/reftests/bidi/reftest.list
@@ -164,14 +164,14 @@ random-if(/^Windows\x20NT\x206\.1/.test(
 fuzzy-if(Android,0-254,0-557) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2a-rtl.html brackets-2a-rtl-ref.html # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2b-ltr.html brackets-2b-ltr-ref.html # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2b-rtl.html brackets-2b-rtl-ref.html # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2c-ltr.html brackets-2c-ltr-ref.html # Bug 1392106
 fuzzy-if(Android,0-254,0-231) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2c-rtl.html brackets-2c-rtl-ref.html # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-3a-ltr.html brackets-3a-ltr-ref.html # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-3a-rtl.html brackets-3a-rtl-ref.html # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-3b-ltr.html brackets-3b-ltr-ref.html # Bug 1392106
-random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-3b-rtl.html brackets-3b-rtl-ref.html # Bug 1392106
+fuzzy-if(Android,207,32) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-3b-rtl.html brackets-3b-rtl-ref.html # Bug 1392106
 == 1217833-1.html 1217833-1-ref.html
 == 1217833-2.html 1217833-2-ref.html
 == 1231175-1.html 1231175-1-ref.html
 == 1366623-1.html 1366623-1-ref.html
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 1426042-1.html 1426042-1-ref.html # Bug 1392106