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

Unified Diff: src/ports/SkFontMgr_android.cpp

Issue 667023002: Revert of Replace SkTypeface::Style with SkFontStyle. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « src/ports/SkFontHost_win.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_android.cpp
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index 15f1d3ed58ba0da153aad7a64504c6908aeedd71..5e93bf8a6208522c600bedca95d02529a3f7f570 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -42,7 +42,7 @@
class SkTypeface_Android : public SkTypeface_FreeType {
public:
SkTypeface_Android(int index,
- const SkFontStyle& style,
+ Style style,
bool isFixedPitch,
const SkString familyName)
: INHERITED(style, SkTypefaceCache::NewFontID(), isFixedPitch)
@@ -65,7 +65,7 @@
public:
SkTypeface_AndroidSystem(const SkString pathName,
int index,
- const SkFontStyle& style,
+ Style style,
bool isFixedPitch,
const SkString familyName,
const SkLanguage& lang,
@@ -100,7 +100,7 @@
public:
SkTypeface_AndroidStream(SkStream* stream,
int index,
- const SkFontStyle& style,
+ Style style,
bool isFixedPitch,
const SkString familyName)
: INHERITED(index, style, isFixedPitch, familyName)
@@ -158,7 +158,7 @@
const int ttcIndex = fontFile.fIndex;
SkString familyName;
- SkFontStyle style;
+ SkTypeface::Style style;
bool isFixedWidth;
if (!SkTypeface_FreeType::ScanFont(stream.get(), ttcIndex,
&familyName, &style, &isFixedWidth)) {
@@ -404,7 +404,7 @@
virtual SkTypeface* onCreateFromStream(SkStream* stream, int ttcIndex) const SK_OVERRIDE {
bool isFixedPitch;
- SkFontStyle style;
+ SkTypeface::Style style;
SkString name;
if (!SkTypeface_FreeType::ScanFont(stream, ttcIndex, &name, &style, &isFixedPitch)) {
return NULL;
@@ -416,7 +416,14 @@
virtual SkTypeface* onLegacyCreateTypeface(const char familyName[],
unsigned styleBits) const SK_OVERRIDE {
- SkFontStyle style = SkFontStyle(styleBits);
+ 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);
if (familyName) {
// On Android, we must return NULL when we can't find the requested
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698