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

@ -1058,16 +1058,6 @@ gfxPlatform::GetWrappedDataSourceSurface(gfxASurface* aSurface)
return result.forget();
}
already_AddRefed<ScaledFont>
gfxPlatform::GetScaledFontForFont(DrawTarget* aTarget, gfxFont *aFont)
{
NativeFont nativeFont;
nativeFont.mType = NativeFontType::CAIRO_FONT_FACE;
nativeFont.mFont = aFont->GetCairoScaledFont();
return Factory::CreateScaledFontForNativeFont(nativeFont,
aFont->GetAdjustedSize());
}
void
gfxPlatform::ComputeTileSize()
{
@ -2172,19 +2162,6 @@ gfxPlatform::DisableBufferRotation()
sBufferRotationCheckPref = false;
}
already_AddRefed<ScaledFont>
gfxPlatform::GetScaledFontForFontWithCairoSkia(DrawTarget* aTarget, gfxFont* aFont)
{
NativeFont nativeFont;
if (aTarget->GetBackendType() == BackendType::CAIRO || aTarget->GetBackendType() == BackendType::SKIA) {
nativeFont.mType = NativeFontType::CAIRO_FONT_FACE;
nativeFont.mFont = aFont->GetCairoScaledFont();
return Factory::CreateScaledFontForNativeFont(nativeFont, aFont->GetAdjustedSize());
}
return nullptr;
}
/* static */ bool
gfxPlatform::UsesOffMainThreadCompositing()
{