Index: third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
diff --git a/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp b/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
index d9af8814f20745f374402948176848edc5db9597..6fe626e80cbb7bba7a58f922ee53e3a7cdc579ee 100644 |
--- a/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
+++ b/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
@@ -216,25 +216,6 @@ const Vector<AtomicString> FontCache::platformFontListForFallbackPriority(FontFa |
return returnVector; |
} |
-#if OS(WIN) |
-static inline SkFontStyle fontStyle(const FontDescription& fontDescription) |
-{ |
- int width = static_cast<int>(fontDescription.stretch()); |
- int weight = (fontDescription.weight() - FontWeight100 + 1) * 100; |
- SkFontStyle::Slant slant = fontDescription.style() == FontStyleItalic |
- ? SkFontStyle::kItalic_Slant |
- : SkFontStyle::kUpright_Slant; |
- return SkFontStyle(weight, width, slant); |
-} |
- |
-static_assert(static_cast<int>(FontStretchUltraCondensed) == static_cast<int>(SkFontStyle::kUltraCondensed_Width), |
- "FontStretchUltraCondensed should map to kUltraCondensed_Width"); |
-static_assert(static_cast<int>(FontStretchNormal) == static_cast<int>(SkFontStyle::kNormal_Width), |
- "FontStretchNormal should map to kNormal_Width"); |
-static_assert(static_cast<int>(FontStretchUltraExpanded) == static_cast<int>(SkFontStyle::kUltaExpanded_Width), |
- "FontStretchUltraExpanded should map to kUltaExpanded_Width"); |
-#endif |
- |
PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDescription, const FontFaceCreationParams& creationParams, CString& name) |
{ |
#if !OS(WIN) && !OS(ANDROID) |
@@ -271,9 +252,8 @@ PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc |
if (m_fontManager) { |
return adoptRef(useDirectWrite() |
- ? m_fontManager->matchFamilyStyle(name.data(), fontStyle(fontDescription)) |
- : m_fontManager->legacyCreateTypeface(name.data(), style) |
- ); |
+ ? m_fontManager->matchFamilyStyle(name.data(), fontDescription.skiaFontStyle()) |
+ : m_fontManager->legacyCreateTypeface(name.data(), style)); |
} |
#endif |