Bug 1621232 - Devirtualize and merge CreateFontGroup implementations, as there is no longer any platform dependency. r=lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D66197

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jonathan Kew 2020-03-10 13:20:37 +00:00
Родитель 73d4e22e87
Коммит c8c463d812
10 изменённых файлов: 14 добавлений и 61 удалений

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

@ -238,14 +238,6 @@ void gfxAndroidPlatform::ReadSystemFontList(
gfxFT2FontList::PlatformFontList()->ReadSystemFontList(aFontList);
}
gfxFontGroup* gfxAndroidPlatform::CreateFontGroup(
const FontFamilyList& aFontFamilyList, const gfxFontStyle* aStyle,
gfxTextPerfMetrics* aTextPerf, gfxUserFontSet* aUserFontSet,
gfxFloat aDevToCssSize) {
return new gfxFontGroup(aFontFamilyList, aStyle, aTextPerf, aUserFontSet,
aDevToCssSize);
}
bool gfxAndroidPlatform::FontHintingEnabled() {
// In "mobile" builds, we sometimes use non-reflow-zoom, so we
// might not want hinting. Let's see.

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

@ -41,12 +41,6 @@ class gfxAndroidPlatform : public gfxPlatform {
void GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh, Script aRunScript,
nsTArray<const char*>& aFontList) override;
gfxFontGroup* CreateFontGroup(const mozilla::FontFamilyList& aFontFamilyList,
const gfxFontStyle* aStyle,
gfxTextPerfMetrics* aTextPerf,
gfxUserFontSet* aUserFontSet,
gfxFloat aDevToCssSize) override;
bool FontHintingEnabled() override;
bool RequiresLinearZoom() override;

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

@ -1964,6 +1964,14 @@ bool gfxPlatform::IsFontFormatSupported(uint32_t aFormatFlags) {
return true;
}
gfxFontGroup* gfxPlatform::CreateFontGroup(
const FontFamilyList& aFontFamilyList, const gfxFontStyle* aStyle,
gfxTextPerfMetrics* aTextPerf, gfxUserFontSet* aUserFontSet,
gfxFloat aDevToCssSize) const {
return new gfxFontGroup(aFontFamilyList, aStyle, aTextPerf, aUserFontSet,
aDevToCssSize);
}
gfxFontEntry* gfxPlatform::LookupLocalFont(const nsACString& aFontName,
WeightRange aWeightForEntry,
StretchRange aStretchForEntry,

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

@ -368,12 +368,13 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener {
const nsACString& aGenericFamily);
/**
* Create the appropriate platform font group
* Create a gfxFontGroup based on the given family list and style.
*/
virtual gfxFontGroup* CreateFontGroup(
const mozilla::FontFamilyList& aFontFamilyList,
const gfxFontStyle* aStyle, gfxTextPerfMetrics* aTextPerf,
gfxUserFontSet* aUserFontSet, gfxFloat aDevToCssSize) = 0;
gfxFontGroup* CreateFontGroup(const mozilla::FontFamilyList& aFontFamilyList,
const gfxFontStyle* aStyle,
gfxTextPerfMetrics* aTextPerf,
gfxUserFontSet* aUserFontSet,
gfxFloat aDevToCssSize) const;
/**
* Look up a local platform font using the full font face name.

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

@ -259,14 +259,6 @@ gfxPlatformFontList* gfxPlatformGtk::CreatePlatformFontList() {
return nullptr;
}
gfxFontGroup* gfxPlatformGtk::CreateFontGroup(
const FontFamilyList& aFontFamilyList, const gfxFontStyle* aStyle,
gfxTextPerfMetrics* aTextPerf, gfxUserFontSet* aUserFontSet,
gfxFloat aDevToCssSize) {
return new gfxFontGroup(aFontFamilyList, aStyle, aTextPerf, aUserFontSet,
aDevToCssSize);
}
// FIXME(emilio, bug 1554850): This should be invalidated somehow, right now
// requires a restart.
static int32_t sDPI = 0;

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

@ -47,12 +47,6 @@ class gfxPlatformGtk : public gfxPlatform {
gfxPlatformFontList* CreatePlatformFontList() override;
gfxFontGroup* CreateFontGroup(const mozilla::FontFamilyList& aFontFamilyList,
const gfxFontStyle* aStyle,
gfxTextPerfMetrics* aTextPerf,
gfxUserFontSet* aUserFontSet,
gfxFloat aDevToCssSize) override;
/**
* Calls XFlush if xrender is enabled.
*/

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

@ -127,14 +127,6 @@ already_AddRefed<gfxASurface> gfxPlatformMac::CreateOffscreenSurface(
return newSurface.forget();
}
gfxFontGroup* gfxPlatformMac::CreateFontGroup(
const FontFamilyList& aFontFamilyList, const gfxFontStyle* aStyle,
gfxTextPerfMetrics* aTextPerf, gfxUserFontSet* aUserFontSet,
gfxFloat aDevToCssSize) {
return new gfxFontGroup(aFontFamilyList, aStyle, aTextPerf, aUserFontSet,
aDevToCssSize);
}
bool gfxPlatformMac::IsFontFormatSupported(uint32_t aFormatFlags) {
if (gfxPlatform::IsFontFormatSupported(aFormatFlags)) {
return true;

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

@ -32,12 +32,6 @@ class gfxPlatformMac : public gfxPlatform {
already_AddRefed<gfxASurface> CreateOffscreenSurface(
const IntSize& aSize, gfxImageFormat aFormat) override;
gfxFontGroup* CreateFontGroup(const mozilla::FontFamilyList& aFontFamilyList,
const gfxFontStyle* aStyle,
gfxTextPerfMetrics* aTextPerf,
gfxUserFontSet* aUserFontSet,
gfxFloat aDevToCssSize) override;
gfxPlatformFontList* CreatePlatformFontList() override;
void ReadSystemFontList(

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

@ -813,14 +813,6 @@ void gfxWindowsPlatform::GetCommonFallbackFonts(
aFontList.AppendElement(kFontArialUnicodeMS);
}
gfxFontGroup* gfxWindowsPlatform::CreateFontGroup(
const FontFamilyList& aFontFamilyList, const gfxFontStyle* aStyle,
gfxTextPerfMetrics* aTextPerf, gfxUserFontSet* aUserFontSet,
gfxFloat aDevToCssSize) {
return new gfxFontGroup(aFontFamilyList, aStyle, aTextPerf, aUserFontSet,
aDevToCssSize);
}
bool gfxWindowsPlatform::DidRenderingDeviceReset(
DeviceResetReason* aResetReason) {
DeviceManagerDx* dm = DeviceManagerDx::Get();

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

@ -151,12 +151,6 @@ class gfxWindowsPlatform : public gfxPlatform {
void GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh, Script aRunScript,
nsTArray<const char*>& aFontList) override;
gfxFontGroup* CreateFontGroup(const mozilla::FontFamilyList& aFontFamilyList,
const gfxFontStyle* aStyle,
gfxTextPerfMetrics* aTextPerf,
gfxUserFontSet* aUserFontSet,
gfxFloat aDevToCssSize) override;
bool CanUseHardwareVideoDecoding() override;
void CompositorUpdated() override;