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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/FontDescription.cpp

Issue 1912013002: Use the new legacyCreateTypeface that has an SkFontStyle parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Treat WebKit oblique style as skia italic style 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 | « no previous file | third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp » ('j') | 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 // FIXME: handle oblique styles when they're supported in skia
bungeman-skia 2016/04/27 20:42:14 So Skia now has an SkFontStyle::kOblique_Slant. I
Tom (Use chromium acct) 2016/04/28 17:49:20 Acknowledged.
285 SkFontStyle::Slant slant = style()
285 ? SkFontStyle::kItalic_Slant 286 ? SkFontStyle::kItalic_Slant
286 : SkFontStyle::kUpright_Slant; 287 : SkFontStyle::kUpright_Slant;
287 return SkFontStyle(numericFontWeight(weight()), width, slant); 288 return SkFontStyle(numericFontWeight(weight()), width, slant);
288 static_assert( 289 static_assert(
289 static_cast<int>(FontStretchUltraCondensed) == static_cast<int>(SkFontSt yle::kUltraCondensed_Width), 290 static_cast<int>(FontStretchUltraCondensed) == static_cast<int>(SkFontSt yle::kUltraCondensed_Width),
290 "FontStretchUltraCondensed should map to kUltraCondensed_Width"); 291 "FontStretchUltraCondensed should map to kUltraCondensed_Width");
291 static_assert( 292 static_assert(
292 static_cast<int>(FontStretchNormal) == static_cast<int>(SkFontStyle::kNo rmal_Width), 293 static_cast<int>(FontStretchNormal) == static_cast<int>(SkFontStyle::kNo rmal_Width),
293 "FontStretchNormal should map to kNormal_Width"); 294 "FontStretchNormal should map to kNormal_Width");
294 static_assert( 295 static_assert(
295 static_cast<int>(FontStretchUltraExpanded) == static_cast<int>(SkFontSty le::kUltaExpanded_Width), 296 static_cast<int>(FontStretchUltraExpanded) == static_cast<int>(SkFontSty le::kUltaExpanded_Width),
296 "FontStretchUltraExpanded should map to kUltaExpanded_Width"); 297 "FontStretchUltraExpanded should map to kUltaExpanded_Width");
297 } 298 }
298 299
299 } // namespace blink 300 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698