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:
Jeff Muizelaar 2017-06-01 16:56:49 -04:00
parent d85c7f6cc3
commit 5fae3040ce
2 changed files with 14 additions and 24 deletions

View File

@ -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

View File

@ -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