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

Unified Diff: third_party/WebKit/Source/platform/fonts/FontDescription.cpp

Issue 1927733002: Request oblique from Skia in Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/FontDescription.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/FontDescription.cpp b/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
index cde54996f91e78b47033a4320ff8b9765813cfd4..4ffcf1fb1a8b4c15eb449ba8ff07d147f0049a11 100644
--- a/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
@@ -281,9 +281,13 @@ unsigned FontDescription::styleHashWithoutFamilyList() const
SkFontStyle FontDescription::skiaFontStyle() const
{
int width = static_cast<int>(stretch());
- SkFontStyle::Slant slant = style() == FontStyleItalic
- ? SkFontStyle::kItalic_Slant
- : SkFontStyle::kUpright_Slant;
+ SkFontStyle::Slant slant = SkFontStyle::kUpright_Slant;
+ switch (style()) {
+ case FontStyleNormal: slant = SkFontStyle::kUpright_Slant; break;
+ case FontStyleItalic: slant = SkFontStyle::kItalic_Slant; break;
+ case FontStyleOblique: slant = SkFontStyle::kOblique_Slant; break;
+ default: NOTREACHED(); break;
+ }
return SkFontStyle(numericFontWeight(weight()), width, slant);
static_assert(
static_cast<int>(FontStretchUltraCondensed) == static_cast<int>(SkFontStyle::kUltraCondensed_Width),
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698