Skip to content

Commit 8896bad

Browse files
jfkthameDonalMe
authored andcommitted
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
1 parent c77d682 commit 8896bad

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

gfx/thebes/gfxTextRun.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,15 +1852,10 @@ gfxFontGroup::gfxFontGroup(nsPresContext* aPresContext,
18521852
mFamilyList(aFontFamilyList),
18531853
mStyle(*aStyle),
18541854
mLanguage(aLanguage),
1855-
mUnderlineOffset(UNDERLINE_OFFSET_NOT_SET),
1856-
mHyphenWidth(-1),
18571855
mDevToCssSize(aDevToCssSize),
18581856
mUserFontSet(aUserFontSet),
18591857
mTextPerf(aTextPerf),
1860-
mLastPrefLang(eFontPrefLang_Western),
18611858
mPageLang(gfxPlatformFontList::GetFontPrefLangFor(aLanguage)),
1862-
mLastPrefFirstFont(false),
1863-
mSkipDrawing(false),
18641859
mExplicitLanguage(aExplicitLanguage) {
18651860
switch (aVariantEmoji) {
18661861
case StyleFontVariantEmoji::Normal:
@@ -1875,7 +1870,6 @@ gfxFontGroup::gfxFontGroup(nsPresContext* aPresContext,
18751870
}
18761871
// We don't use SetUserFontSet() here, as we want to unconditionally call
18771872
// EnsureFontList() rather than only do UpdateUserFonts() if it changed.
1878-
mCurrGeneration = 0;
18791873
}
18801874

18811875
gfxFontGroup::~gfxFontGroup() {

gfx/thebes/gfxTextRun.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,13 +1368,13 @@ class gfxFontGroup final : public gfxTextRunFactory {
13681368

13691369
RefPtr<nsAtom> mLanguage;
13701370

1371-
gfxFloat mUnderlineOffset;
1372-
gfxFloat mHyphenWidth;
1371+
gfxFloat mUnderlineOffset = UNDERLINE_OFFSET_NOT_SET;
1372+
gfxFloat mHyphenWidth = -1.0; // negative indicates not yet measured
13731373
gfxFloat mDevToCssSize;
13741374

13751375
RefPtr<gfxUserFontSet> mUserFontSet;
1376-
uint64_t mCurrGeneration; // track the current user font set generation,
1377-
// rebuild font list if needed
1376+
uint64_t mCurrGeneration = 0; // track the current user font set generation,
1377+
// rebuild font list if needed
13781378

13791379
gfxTextPerfMetrics* mTextPerf;
13801380

@@ -1385,16 +1385,17 @@ class gfxFontGroup final : public gfxTextRunFactory {
13851385
// cache the most recent pref font to avoid general pref font lookup
13861386
FontFamily mLastPrefFamily;
13871387
RefPtr<gfxFont> mLastPrefFont;
1388-
eFontPrefLang mLastPrefLang; // lang group for last pref font
1388+
eFontPrefLang mLastPrefLang = eFontPrefLang_Western; // lang group for last
1389+
// pref font
13891390
eFontPrefLang mPageLang;
13901391
bool mLastPrefFirstFont; // is this the first font in the list of pref fonts
13911392
// for this lang group?
13921393

1393-
bool mSkipDrawing; // hide text while waiting for a font
1394-
// download to complete (or fallback
1395-
// timer to fire)
1394+
bool mSkipDrawing = false; // hide text while waiting for a font
1395+
// download to complete (or fallback
1396+
// timer to fire)
13961397

1397-
bool mExplicitLanguage; // Does mLanguage come from an explicit attribute?
1398+
bool mExplicitLanguage = false; // Is mLanguage from an explicit attribute?
13981399

13991400
bool mResolvedFonts = false; // Whether the mFonts array has been set up.
14001401

0 commit comments

Comments
 (0)