import from UXP: [gfx] Ensure font entry's unitsPerEm and font extents are initialized when gfxFont is created. (7672f932)

This commit is contained in:
2024-05-22 15:41:47 +08:00
parent e63613265e
commit a2d9407538
+4
View File
@@ -856,6 +856,10 @@ gfxFont::gfxFont(gfxFontEntry *aFontEntry, const gfxFontStyle *aFontStyle,
++gFontCount;
#endif
mKerningSet = HasFeatureSet(HB_TAG('k','e','r','n'), mKerningEnabled);
// Ensure the gfxFontEntry's unitsPerEm and extents fields are initialized,
// so that GetFontExtents can use them without risk of races.
Unused << mFontEntry->UnitsPerEm();
}
gfxFont::~gfxFont()