Bug 1696407: Don't use GDI font table loading for DWrite when win32k lockdown is enabled. r=jfkthame

Differential Revision: https://phabricator.services.mozilla.com/D107488
This commit is contained in:
Bob Owen 2021-03-10 14:26:53 +00:00
Родитель c07664d701
Коммит a205d49f42
2 изменённых файлов: 8 добавлений и 1 удалений

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

@ -18,6 +18,7 @@
#include "mozilla/Sprintf.h"
#include "mozilla/StaticPrefs_gfx.h"
#include "mozilla/Telemetry.h"
#include "mozilla/WindowsProcessMitigations.h"
#include "mozilla/WindowsVersion.h"
#include "nsDirectoryServiceUtils.h"
#include "nsDirectoryServiceDefs.h"
@ -968,6 +969,12 @@ gfxFontEntry* gfxDWriteFontList::MakePlatformFont(
return entry.release();
}
bool gfxDWriteFontList::UseGDIFontTableAccess() const {
// Using GDI font table access for DWrite is controlled by a pref, but also we
// must be able to make win32k calls.
return mGDIFontTableAccess && !IsWin32kLockedDown();
}
static void GetPostScriptNameFromNameTable(IDWriteFontFace* aFace,
nsCString& aName) {
const auto kNAME =

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

@ -406,7 +406,7 @@ class gfxDWriteFontList final : public gfxPlatformFontList {
uint32_t aLength) override;
IDWriteGdiInterop* GetGDIInterop() { return mGDIInterop; }
bool UseGDIFontTableAccess() { return mGDIFontTableAccess; }
bool UseGDIFontTableAccess() const;
bool FindAndAddFamilies(mozilla::StyleGenericFontFamily aGeneric,
const nsACString& aFamily,