Bug 1971053 - patch 1 - Minor cleanup in gfxFontGroup. a=dmeehan

Just cleaning up the gfxFontGroup constructor; no functional change.

Original Revision: https://phabricator.services.mozilla.com/D253739

Differential Revision: https://phabricator.services.mozilla.com/D253938
This commit is contained in:
Jonathan Kew
2025-07-04 17:08:16 +00:00
committed by dmeehan@mozilla.com
parent 690430599d
commit 38ca6718c3
2 changed files with 10 additions and 15 deletions

View File

@@ -1852,15 +1852,10 @@ gfxFontGroup::gfxFontGroup(nsPresContext* aPresContext,
mFamilyList(aFontFamilyList),
mStyle(*aStyle),
mLanguage(aLanguage),
mUnderlineOffset(UNDERLINE_OFFSET_NOT_SET),
mHyphenWidth(-1),
mDevToCssSize(aDevToCssSize),
mUserFontSet(aUserFontSet),
mTextPerf(aTextPerf),
mLastPrefLang(eFontPrefLang_Western),
mPageLang(gfxPlatformFontList::GetFontPrefLangFor(aLanguage)),
mLastPrefFirstFont(false),
mSkipDrawing(false),
mExplicitLanguage(aExplicitLanguage) {
switch (aVariantEmoji) {
case StyleFontVariantEmoji::Normal:
@@ -1875,7 +1870,6 @@ gfxFontGroup::gfxFontGroup(nsPresContext* aPresContext,
}
// We don't use SetUserFontSet() here, as we want to unconditionally call
// EnsureFontList() rather than only do UpdateUserFonts() if it changed.
mCurrGeneration = 0;
}
gfxFontGroup::~gfxFontGroup() {

View File

@@ -1368,13 +1368,13 @@ class gfxFontGroup final : public gfxTextRunFactory {
RefPtr<nsAtom> mLanguage;
gfxFloat mUnderlineOffset;
gfxFloat mHyphenWidth;
gfxFloat mUnderlineOffset = UNDERLINE_OFFSET_NOT_SET;
gfxFloat mHyphenWidth = -1.0; // negative indicates not yet measured
gfxFloat mDevToCssSize;
RefPtr<gfxUserFontSet> mUserFontSet;
uint64_t mCurrGeneration; // track the current user font set generation,
// rebuild font list if needed
uint64_t mCurrGeneration = 0; // track the current user font set generation,
// rebuild font list if needed
gfxTextPerfMetrics* mTextPerf;
@@ -1385,16 +1385,17 @@ class gfxFontGroup final : public gfxTextRunFactory {
// cache the most recent pref font to avoid general pref font lookup
FontFamily mLastPrefFamily;
RefPtr<gfxFont> mLastPrefFont;
eFontPrefLang mLastPrefLang; // lang group for last pref font
eFontPrefLang mLastPrefLang = eFontPrefLang_Western; // lang group for last
// pref font
eFontPrefLang mPageLang;
bool mLastPrefFirstFont; // is this the first font in the list of pref fonts
// for this lang group?
bool mSkipDrawing; // hide text while waiting for a font
// download to complete (or fallback
// timer to fire)
bool mSkipDrawing = false; // hide text while waiting for a font
// download to complete (or fallback
// timer to fire)
bool mExplicitLanguage; // Does mLanguage come from an explicit attribute?
bool mExplicitLanguage = false; // Is mLanguage from an explicit attribute?
bool mResolvedFonts = false; // Whether the mFonts array has been set up.