Issue #2191 - Require implementation of gfxFont::GetScaledFont and remove unnecessary gfxPlatform::GetScaledFontForFont.

Backported from Mozilla bug 1385029.
This commit is contained in:
Job Bautista 2023-04-05 19:33:07 +08:00 committed by roytam1
commit 0f7750cd27
17 changed files with 90 additions and 135 deletions

View file

@ -1103,6 +1103,20 @@ gfxFontconfigFont::~gfxFontconfigFont()
{
}
already_AddRefed<ScaledFont>
gfxFontconfigFont::GetScaledFont(mozilla::gfx::DrawTarget *aTarget)
{
if (!mAzureScaledFont) {
mAzureScaledFont =
Factory::CreateScaledFontForFontconfigFont(GetCairoScaledFont(),
GetPattern(),
GetAdjustedSize());
}
RefPtr<ScaledFont> scaledFont(mAzureScaledFont);
return scaledFont.forget();
}
gfxFcPlatformFontList::gfxFcPlatformFontList()
: mLocalNames(64)
, mGenericMappings(32)