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

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

Issue 1877673002: Move legacyCreateTypeface to SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DEPS change now that Skia change has landed. 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
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 59cd332406b7539fed65aba3e116a4929c30f836..dd414101083c219e1f8b9c1e9b53ab62966701de 100644
--- a/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp
+++ b/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp
@@ -210,12 +210,6 @@ PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc
name = family.utf8();
}
- int style = SkTypeface::kNormal;
- if (fontDescription.weight() >= FontWeight600)
- style |= SkTypeface::kBold;
- if (fontDescription.style())
- style |= SkTypeface::kItalic;
-
#if OS(WIN)
if (s_sideloadedFonts) {
HashMap<String, RefPtr<SkTypeface>>::iterator sideloadedFont =
@@ -227,7 +221,7 @@ 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->legacyCreateTypeface(name.data(), fontStyle(fontDescription))
);
}
#endif
@@ -242,6 +236,11 @@ PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc
// 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)));
}

Powered by Google App Engine
This is Rietveld 408576698