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

View File

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