forked from mirrors/gecko-dev
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:
parent
e602167d1b
commit
cf58f732be
2 changed files with 10 additions and 0 deletions
|
|
@ -157,6 +157,12 @@ class gfxVars final {
|
||||||
size_t mIndex;
|
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:
|
private:
|
||||||
static StaticAutoPtr<gfxVars> sInstance;
|
static StaticAutoPtr<gfxVars> sInstance;
|
||||||
static StaticAutoPtr<nsTArray<VarBase*>> sVarList;
|
static StaticAutoPtr<nsTArray<VarBase*>> sVarList;
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,10 @@ bool gfxDWriteFont::InitDWriteSupport() {
|
||||||
void gfxDWriteFont::UpdateSystemTextVars() {
|
void gfxDWriteFont::UpdateSystemTextVars() {
|
||||||
MOZ_ASSERT(XRE_IsParentProcess());
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
|
|
||||||
|
if (!gfxVars::IsInitialized()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
BYTE newQuality = GetSystemTextQuality();
|
BYTE newQuality = GetSystemTextQuality();
|
||||||
if (gfxVars::SystemTextQuality() != newQuality) {
|
if (gfxVars::SystemTextQuality() != newQuality) {
|
||||||
gfxVars::SetSystemTextQuality(newQuality);
|
gfxVars::SetSystemTextQuality(newQuality);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue