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

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

Issue 2807913002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/fonts (Closed)
Patch Set: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/fonts Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Brent Fulgham 2 * Copyright (C) 2011 Brent Fulgham
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 && m_style == a.m_style 216 && m_style == a.m_style
217 #endif 217 #endif
218 && m_orientation == a.m_orientation; 218 && m_orientation == a.m_orientation;
219 } 219 }
220 220
221 SkFontID FontPlatformData::uniqueID() const { 221 SkFontID FontPlatformData::uniqueID() const {
222 return typeface()->uniqueID(); 222 return typeface()->uniqueID();
223 } 223 }
224 224
225 String FontPlatformData::fontFamilyName() const { 225 String FontPlatformData::fontFamilyName() const {
226 ASSERT(this->typeface()); 226 DCHECK(this->typeface());
227 SkTypeface::LocalizedStrings* fontFamilyIterator = 227 SkTypeface::LocalizedStrings* fontFamilyIterator =
228 this->typeface()->createFamilyNameIterator(); 228 this->typeface()->createFamilyNameIterator();
229 SkTypeface::LocalizedString localizedString; 229 SkTypeface::LocalizedString localizedString;
230 while (fontFamilyIterator->next(&localizedString) && 230 while (fontFamilyIterator->next(&localizedString) &&
231 !localizedString.fString.size()) { 231 !localizedString.fString.size()) {
232 } 232 }
233 fontFamilyIterator->unref(); 233 fontFamilyIterator->unref();
234 return String(localizedString.fString.c_str()); 234 return String(localizedString.fString.c_str());
235 } 235 }
236 236
(...skipping 22 matching lines...) Expand all
259 return false; 259 return false;
260 } 260 }
261 261
262 bool FontPlatformData::hasSpaceInLigaturesOrKerning( 262 bool FontPlatformData::hasSpaceInLigaturesOrKerning(
263 TypesettingFeatures features) const { 263 TypesettingFeatures features) const {
264 HarfBuzzFace* hbFace = harfBuzzFace(); 264 HarfBuzzFace* hbFace = harfBuzzFace();
265 if (!hbFace) 265 if (!hbFace)
266 return false; 266 return false;
267 267
268 hb_font_t* font = hbFace->getScaledFont(); 268 hb_font_t* font = hbFace->getScaledFont();
269 ASSERT(font); 269 DCHECK(font);
270 hb_face_t* face = hb_font_get_face(font); 270 hb_face_t* face = hb_font_get_face(font);
271 ASSERT(face); 271 DCHECK(face);
272 272
273 hb_codepoint_t space; 273 hb_codepoint_t space;
274 // If the space glyph isn't present in the font then each space character 274 // If the space glyph isn't present in the font then each space character
275 // will be rendering using a fallback font, which grantees that it cannot 275 // will be rendering using a fallback font, which grantees that it cannot
276 // affect the shape of the preceding word. 276 // affect the shape of the preceding word.
277 if (!hb_font_get_glyph(font, spaceCharacter, 0, &space)) 277 if (!hb_font_get_glyph(font, spaceCharacter, 0, &space))
278 return false; 278 return false;
279 279
280 if (!hb_ot_layout_has_substitution(face) && 280 if (!hb_ot_layout_has_substitution(face) &&
281 !hb_ot_layout_has_positioning(face)) { 281 !hb_ot_layout_has_positioning(face)) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 const size_t tableSize = m_typeface->getTableSize(tag); 335 const size_t tableSize = m_typeface->getTableSize(tag);
336 if (tableSize) { 336 if (tableSize) {
337 Vector<char> tableBuffer(tableSize); 337 Vector<char> tableBuffer(tableSize);
338 m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]); 338 m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]);
339 buffer = SharedBuffer::adoptVector(tableBuffer); 339 buffer = SharedBuffer::adoptVector(tableBuffer);
340 } 340 }
341 return buffer.release(); 341 return buffer.release();
342 } 342 }
343 343
344 } // namespace blink 344 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698