Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Unified Diff: third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp

Issue 1912013002: Use the new legacyCreateTypeface that has an SkFontStyle parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use the new legacyCreateTypeface that has an SkFontStyle paramete Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2f7efda1693b76956f6b6a2cbd7c381d575ac600 100644
--- a/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp
+++ b/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp
@@ -234,14 +234,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)));
}
#if !OS(WIN)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698