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

Unified Diff: src/fonts/SkFontMgr_indirect.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/fonts/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkFontConfigInterface_direct.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/fonts/SkFontMgr_indirect.cpp
diff --git a/src/fonts/SkFontMgr_indirect.cpp b/src/fonts/SkFontMgr_indirect.cpp
index fc0bd5c7ce8b16af764840da6cc5943937e7acbb..4d226da855f9296100ffee0ef6edc549c98ab5f1 100644
--- a/src/fonts/SkFontMgr_indirect.cpp
+++ b/src/fonts/SkFontMgr_indirect.cpp
@@ -184,16 +184,14 @@ SkTypeface* SkFontMgr_Indirect::onCreateFromData(SkData* data, int ttcIndex) con
return fImpl->createFromData(data, ttcIndex);
}
+#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
SkTypeface* SkFontMgr_Indirect::onLegacyCreateTypeface(const char familyName[],
unsigned styleBits) const {
- bool bold = SkToBool(styleBits & SkTypeface::kBold);
- bool italic = SkToBool(styleBits & SkTypeface::kItalic);
- SkFontStyle style = SkFontStyle(bold ? SkFontStyle::kBold_Weight
- : SkFontStyle::kNormal_Weight,
- SkFontStyle::kNormal_Width,
- italic ? SkFontStyle::kItalic_Slant
- : SkFontStyle::kUpright_Slant);
-
+ SkFontStyle style = SkFontStyle::FromOldStyle(styleBits);
+#else
+SkTypeface* SkFontMgr_Indirect::onLegacyCreateTypeface(const char familyName[],
+ SkFontStyle style) const {
+#endif
SkAutoTUnref<SkTypeface> face(this->matchFamilyStyle(familyName, style));
if (nullptr == face.get()) {
« no previous file with comments | « src/fonts/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkFontConfigInterface_direct.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698