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

Unified Diff: src/core/SkTypeface.cpp

Issue 1873923002: Begin switch to SkFontStyle for legacy calls. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Dont update bzl file now. 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 | « src/core/SkFontStyle.cpp ('k') | src/fonts/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTypeface.cpp
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index dc5306331ce55de728f086b5da9401289023364d..f9e5b5f43bb490a42f8927b044f84d7ddaad81e1 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -87,7 +87,11 @@ SkTypeface* SkTypeface::GetDefaultTypeface(Style style) {
SkAutoMutexAcquire lock(&gCreateDefaultMutex);
SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault());
+#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
SkTypeface* t = fm->legacyCreateTypeface(nullptr, style);
+#else
+ SkTypeface* t = fm->legacyCreateTypeface(nullptr, SkFontStyle::FromOldStyle(style));
+#endif
return t ? t : SkEmptyTypeface::Create();
});
}
@@ -120,7 +124,11 @@ SkTypeface* SkTypeface::CreateFromName(const char name[], Style style) {
return RefDefault(style);
}
SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault());
+#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
return fm->legacyCreateTypeface(name, style);
+#else
+ return fm->legacyCreateTypeface(name, SkFontStyle::FromOldStyle(style));
+#endif
}
SkTypeface* SkTypeface::CreateFromTypeface(const SkTypeface* family, Style s) {
« no previous file with comments | « src/core/SkFontStyle.cpp ('k') | src/fonts/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698