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

Unified Diff: src/core/SkFontStyle.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/SkFontMgr.cpp ('k') | src/core/SkTypeface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkFontStyle.cpp
diff --git a/src/core/SkFontStyle.cpp b/src/core/SkFontStyle.cpp
index badf9d7a9d88ba959e5af42ce705da3ee07a009a..c28e7213377c8ea451a00db2ab41fb0d175de609 100644
--- a/src/core/SkFontStyle.cpp
+++ b/src/core/SkFontStyle.cpp
@@ -23,11 +23,10 @@ SkFontStyle::SkFontStyle(int weight, int width, Slant slant) {
fUnion.fR.fSlant = SkTPin<int>(slant, kUpright_Slant, kItalic_Slant);
}
-SkFontStyle::SkFontStyle(unsigned oldStyle) {
- fUnion.fU32 = 0;
- fUnion.fR.fWeight = (oldStyle & SkTypeface::kBold) ? SkFontStyle::kBold_Weight
- : SkFontStyle::kNormal_Weight;
- fUnion.fR.fWidth = SkFontStyle::kNormal_Width;
- fUnion.fR.fSlant = (oldStyle & SkTypeface::kItalic) ? SkFontStyle::kItalic_Slant
- : SkFontStyle::kUpright_Slant;
+/*static*/SkFontStyle SkFontStyle::FromOldStyle(unsigned oldStyle) {
+ return SkFontStyle((oldStyle & SkTypeface::kBold) ? SkFontStyle::kBold_Weight
+ : SkFontStyle::kNormal_Weight,
+ SkFontStyle::kNormal_Width,
+ (oldStyle & SkTypeface::kItalic) ? SkFontStyle::kItalic_Slant
+ : SkFontStyle::kUpright_Slant);
}
« no previous file with comments | « src/core/SkFontMgr.cpp ('k') | src/core/SkTypeface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698