Chromium Code Reviews| 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 dd414101083c219e1f8b9c1e9b53ab62966701de..4029b509c0833358a1236b0a1c0ddb69a65e698e 100644 |
| --- a/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
| +++ b/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
| @@ -171,7 +171,6 @@ PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescri |
| return fontDataFromFontPlatformData(fontPlatformData, shouldRetain); |
| } |
| -#if OS(WIN) || OS(LINUX) |
| static inline SkFontStyle fontStyle(const FontDescription& fontDescription) |
| { |
| int width = static_cast<int>(fontDescription.stretch()); |
| @@ -188,7 +187,6 @@ static_assert(static_cast<int>(FontStretchNormal) == static_cast<int>(SkFontStyl |
| "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) |
| { |
| @@ -234,14 +232,11 @@ PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc |
| return adoptRef(m_fontManager->matchFamilyStyle(name.data(), fontStyle(fontDescription))); |
| #endif |
| - // FIXME: Use m_fontManager, SkFontStyle and matchFamilyStyle instead of |
| - // CreateFromName on all platforms. |
| - int style = SkTypeface::kNormal; |
| - if (fontDescription.weight() >= FontWeight600) |
| - style |= SkTypeface::kBold; |
| - if (fontDescription.style()) |
| - style |= SkTypeface::kItalic; |
| - return adoptRef(SkTypeface::CreateFromName(name.data(), static_cast<SkTypeface::Style>(style))); |
| + // FIXME: Use m_fontManager, matchFamilyStyle instead of |
| + // legacyCreateTypeface on all platforms. |
| + RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault()); |
| + return adoptRef(fm->legacyCreateTypeface(name.data(), |
| + fontStyle(fontDescription))); |
|
bungeman-skia
2016/04/22 19:00:21
nit: eae probably knows about this better than I d
|
| } |
| #if !OS(WIN) |