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

Unified Diff: src/ports/SkFontMgr_custom.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/ports/SkFontMgr_android.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontMgr_custom.cpp
diff --git a/src/ports/SkFontMgr_custom.cpp b/src/ports/SkFontMgr_custom.cpp
index c77fe394b138cf14868a6ce368e799474d4829cb..6749ced350fd10d311e71b3c29b71c31207a2aea 100644
--- a/src/ports/SkFontMgr_custom.cpp
+++ b/src/ports/SkFontMgr_custom.cpp
@@ -308,15 +308,12 @@ protected:
return stream.get() ? this->createFromStream(stream.release(), ttcIndex) : nullptr;
}
+#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override {
- SkTypeface::Style oldStyle = (SkTypeface::Style)styleBits;
- SkFontStyle style = SkFontStyle(oldStyle & SkTypeface::kBold
- ? SkFontStyle::kBold_Weight
- : SkFontStyle::kNormal_Weight,
- SkFontStyle::kNormal_Width,
- oldStyle & SkTypeface::kItalic
- ? SkFontStyle::kItalic_Slant
- : SkFontStyle::kUpright_Slant);
+ SkFontStyle style = SkFontStyle::FromOldStyle(styleBits);
+#else
+ SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle style) const override {
+#endif
SkTypeface* tf = nullptr;
if (familyName) {
« no previous file with comments | « src/ports/SkFontMgr_android.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698