Bug 1856637 - Ignore gfxDWriteFont::UpdateSystemTextVars() call if the gfxVars are not yet initialized. r=gfx-reviewers,lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D190151
This commit is contained in:
Jonathan Kew 2023-10-05 10:53:52 +00:00
Родитель e602167d1b
Коммит cf58f732be
2 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -157,6 +157,12 @@ class gfxVars final {
size_t mIndex;
};
// Whether the gfxVars singleton instance has been initialized. Most gfx code
// doesn't need to check this, but code that can potentially run before
// gfxPlatform initialization can use this to check whether gfxVars are
// available yet.
static bool IsInitialized() { return sInstance != nullptr; }
private:
static StaticAutoPtr<gfxVars> sInstance;
static StaticAutoPtr<nsTArray<VarBase*>> sVarList;

Просмотреть файл

@ -135,6 +135,10 @@ bool gfxDWriteFont::InitDWriteSupport() {
void gfxDWriteFont::UpdateSystemTextVars() {
MOZ_ASSERT(XRE_IsParentProcess());
if (!gfxVars::IsInitialized()) {
return;
}
BYTE newQuality = GetSystemTextQuality();
if (gfxVars::SystemTextQuality() != newQuality) {
gfxVars::SetSystemTextQuality(newQuality);