mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
Bug 1369490. Remove some backend type checks that aren't needed. r=lsalzman
This checks won't work with the forthcoming recording backend and don't seem to really be accomplishing anything.
This commit is contained in:
parent
d85c7f6cc3
commit
5fae3040ce
@ -2436,15 +2436,11 @@ 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->GetUnscaledFont(),
|
||||
aFont->GetAdjustedSize());
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
nativeFont.mType = NativeFontType::CAIRO_FONT_FACE;
|
||||
nativeFont.mFont = aFont->GetCairoScaledFont();
|
||||
return Factory::CreateScaledFontForNativeFont(nativeFont,
|
||||
aFont->GetUnscaledFont(),
|
||||
aFont->GetAdjustedSize());
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
|
@ -595,21 +595,15 @@ gfxPlatformGtk::GetGdkDrawable(cairo_surface_t *target)
|
||||
already_AddRefed<ScaledFont>
|
||||
gfxPlatformGtk::GetScaledFontForFont(DrawTarget* aTarget, gfxFont *aFont)
|
||||
{
|
||||
switch (aTarget->GetBackendType()) {
|
||||
case BackendType::CAIRO:
|
||||
case BackendType::SKIA:
|
||||
if (aFont->GetType() == gfxFont::FONT_TYPE_FONTCONFIG) {
|
||||
gfxFontconfigFontBase* fcFont = static_cast<gfxFontconfigFontBase*>(aFont);
|
||||
return Factory::CreateScaledFontForFontconfigFont(
|
||||
fcFont->GetCairoScaledFont(),
|
||||
fcFont->GetPattern(),
|
||||
fcFont->GetUnscaledFont(),
|
||||
fcFont->GetAdjustedSize());
|
||||
}
|
||||
MOZ_FALLTHROUGH;
|
||||
default:
|
||||
return GetScaledFontForFontWithCairoSkia(aTarget, aFont);
|
||||
}
|
||||
if (aFont->GetType() == gfxFont::FONT_TYPE_FONTCONFIG) {
|
||||
gfxFontconfigFontBase* fcFont = static_cast<gfxFontconfigFontBase*>(aFont);
|
||||
return Factory::CreateScaledFontForFontconfigFont(
|
||||
fcFont->GetCairoScaledFont(),
|
||||
fcFont->GetPattern(),
|
||||
fcFont->GetUnscaledFont(),
|
||||
fcFont->GetAdjustedSize());
|
||||
}
|
||||
return GetScaledFontForFontWithCairoSkia(aTarget, aFont);
|
||||
}
|
||||
|
||||
#ifdef GL_PROVIDER_GLX
|
||||
|
Loading…
Reference in New Issue
Block a user