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

Side by Side 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, 7 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Nicholas Shanks <contact@nickshanks.com> 2 * Copyright (C) 2007 Nicholas Shanks <contact@nickshanks.com>
3 * Copyright (C) 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2008 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 addFloatToHash(hash, m_wordSpacing); 274 addFloatToHash(hash, m_wordSpacing);
275 addToHash(hash, m_fieldsAsUnsigned[0]); 275 addToHash(hash, m_fieldsAsUnsigned[0]);
276 addToHash(hash, m_fieldsAsUnsigned[1]); 276 addToHash(hash, m_fieldsAsUnsigned[1]);
277 277
278 return hash; 278 return hash;
279 } 279 }
280 280
281 SkFontStyle FontDescription::skiaFontStyle() const 281 SkFontStyle FontDescription::skiaFontStyle() const
282 { 282 {
283 int width = static_cast<int>(stretch()); 283 int width = static_cast<int>(stretch());
284 SkFontStyle::Slant slant = style() == FontStyleItalic 284 SkFontStyle::Slant slant = SkFontStyle::kUpright_Slant;
285 ? SkFontStyle::kItalic_Slant 285 switch (style()) {
286 : SkFontStyle::kUpright_Slant; 286 case FontStyleNormal: slant = SkFontStyle::kUpright_Slant; break;
287 case FontStyleItalic: slant = SkFontStyle::kItalic_Slant; break;
288 case FontStyleOblique: slant = SkFontStyle::kOblique_Slant; break;
289 default: NOTREACHED(); break;
290 }
287 return SkFontStyle(numericFontWeight(weight()), width, slant); 291 return SkFontStyle(numericFontWeight(weight()), width, slant);
288 static_assert( 292 static_assert(
289 static_cast<int>(FontStretchUltraCondensed) == static_cast<int>(SkFontSt yle::kUltraCondensed_Width), 293 static_cast<int>(FontStretchUltraCondensed) == static_cast<int>(SkFontSt yle::kUltraCondensed_Width),
290 "FontStretchUltraCondensed should map to kUltraCondensed_Width"); 294 "FontStretchUltraCondensed should map to kUltraCondensed_Width");
291 static_assert( 295 static_assert(
292 static_cast<int>(FontStretchNormal) == static_cast<int>(SkFontStyle::kNo rmal_Width), 296 static_cast<int>(FontStretchNormal) == static_cast<int>(SkFontStyle::kNo rmal_Width),
293 "FontStretchNormal should map to kNormal_Width"); 297 "FontStretchNormal should map to kNormal_Width");
294 static_assert( 298 static_assert(
295 static_cast<int>(FontStretchUltraExpanded) == static_cast<int>(SkFontSty le::kUltaExpanded_Width), 299 static_cast<int>(FontStretchUltraExpanded) == static_cast<int>(SkFontSty le::kUltaExpanded_Width),
296 "FontStretchUltraExpanded should map to kUltaExpanded_Width"); 300 "FontStretchUltraExpanded should map to kUltaExpanded_Width");
297 } 301 }
298 302
299 } // namespace blink 303 } // namespace blink
OLDNEW
« 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