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

Unified Diff: src/core/SkFontHost.cpp

Issue 488143002: Replace SkTypeface::Style with SkFontStyle. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add expectations, remove whitespace. Created 6 years, 2 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 | « include/ports/SkFontStyle.h ('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/SkFontHost.cpp
diff --git a/src/core/SkFontHost.cpp b/src/core/SkFontHost.cpp
index ce73491c7271e4fdc40a510ecf1f0671a7156eee..77b80e88219e8a26efff200a03101ed18dc126ce 100644
--- a/src/core/SkFontHost.cpp
+++ b/src/core/SkFontHost.cpp
@@ -67,6 +67,15 @@ SkFontStyle::SkFontStyle(int weight, int width, Slant slant) {
fUnion.fR.fSlant = SkPin32(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;
+}
+
#include "SkFontMgr.h"
class SkEmptyFontStyleSet : public SkFontStyleSet {
« no previous file with comments | « include/ports/SkFontStyle.h ('k') | src/core/SkTypeface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698