Bug 1464094 - follow-up - check that dlsym succeeded in ApplyVariations. r=me
authorLee Salzman <lsalzman@mozilla.com>
Fri, 01 Jun 2018 15:39:50 -0400
changeset 420944 a1a0759ac7190ac9f726fcc6dae8a268c660e95b
parent 420943 5b4895ad57fc37c84c59f08170a4fb380580afe8
child 420945 9019db1eaddb79dbfd1d4c357765599499eb02b4
push id34083
push userapavel@mozilla.com
push dateSat, 02 Jun 2018 23:03:25 +0000
treeherdermozilla-central@1f62ecdf59b6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1464094
milestone62.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 1464094 - follow-up - check that dlsym succeeded in ApplyVariations. r=me MozReview-Commit-ID: 5lrrnFVKMS0
gfx/2d/ScaledFontFontconfig.cpp
--- a/gfx/2d/ScaledFontFontconfig.cpp
+++ b/gfx/2d/ScaledFontFontconfig.cpp
@@ -584,16 +584,20 @@ ScaledFontFontconfig::ApplyVariations(co
   typedef FT_Error (*SetVarDesignCoordsFunc)(FT_Face, FT_UInt, FT_Fixed*);
   static SetVarDesignCoordsFunc setCoords;
   static bool firstTime = true;
   if (firstTime) {
     firstTime = false;
     setCoords = (SetVarDesignCoordsFunc)dlsym(RTLD_DEFAULT, "FT_Set_Var_Design_Coordinates");
   }
 
+  if (!setCoords) {
+    return;
+  }
+
   cairo_scaled_font_t* sf = GetCairoScaledFont();
   FT_Face face = cairo_ft_scaled_font_lock_face(sf);
   if (face && face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS) {
     StackArray<FT_Fixed, 32> coords(aNumVariations);
     for (uint32_t i = 0; i < aNumVariations; i++) {
       coords[i] = std::round(aVariations[i].mValue * 65536.0f);
     }
     if ((*setCoords)(face, aNumVariations, coords.data()) != FT_Err_Ok) {