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

Side by Side Diff: Source/platform/fonts/skia/FontCacheSkia.cpp

Issue 124003003: Add ascii() / latin1() / utf8() methods to AtomicString to avoid having to call string() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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 | « Source/modules/websockets/WebSocket.cpp ('k') | Source/platform/text/TextBreakIteratorICU.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) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (c) 2006, 2007, 2008, 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 FontDescription::GenericFamilyType type = fontDescription.genericFamily( ); 126 FontDescription::GenericFamilyType type = fontDescription.genericFamily( );
127 for (unsigned i = 0; i < SK_ARRAY_COUNT(fontDescriptions); i++) { 127 for (unsigned i = 0; i < SK_ARRAY_COUNT(fontDescriptions); i++) {
128 if (type == fontDescriptions[i].mType) { 128 if (type == fontDescriptions[i].mType) {
129 name = fontDescriptions[i].mName; 129 name = fontDescriptions[i].mName;
130 break; 130 break;
131 } 131 }
132 } 132 }
133 } else { 133 } else {
134 // convert the name to utf8 134 // convert the name to utf8
135 name = family.string().utf8(); 135 name = family.utf8();
136 } 136 }
137 137
138 int style = SkTypeface::kNormal; 138 int style = SkTypeface::kNormal;
139 if (fontDescription.weight() >= FontWeightBold) 139 if (fontDescription.weight() >= FontWeightBold)
140 style |= SkTypeface::kBold; 140 style |= SkTypeface::kBold;
141 if (fontDescription.italic()) 141 if (fontDescription.italic())
142 style |= SkTypeface::kItalic; 142 style |= SkTypeface::kItalic;
143 143
144 // FIXME: Use SkFontStyle and matchFamilyStyle instead of legacyCreateTypefa ce. 144 // FIXME: Use SkFontStyle and matchFamilyStyle instead of legacyCreateTypefa ce.
145 #if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS) 145 #if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS)
(...skipping 17 matching lines...) Expand all
163 fontSize, 163 fontSize,
164 (fontDescription.weight() >= FontWeightBold && !tf->isBold()) || fontDes cription.isSyntheticBold(), 164 (fontDescription.weight() >= FontWeightBold && !tf->isBold()) || fontDes cription.isSyntheticBold(),
165 (fontDescription.italic() && !tf->isItalic()) || fontDescription.isSynth eticItalic(), 165 (fontDescription.italic() && !tf->isItalic()) || fontDescription.isSynth eticItalic(),
166 fontDescription.orientation(), 166 fontDescription.orientation(),
167 fontDescription.useSubpixelPositioning()); 167 fontDescription.useSubpixelPositioning());
168 return result; 168 return result;
169 } 169 }
170 #endif // !OS(WINDOWNS) 170 #endif // !OS(WINDOWNS)
171 171
172 } // namespace WebCore 172 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/websockets/WebSocket.cpp ('k') | Source/platform/text/TextBreakIteratorICU.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698