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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/SimpleFontData.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) 2005, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Alexey Proskuryakov 3 * Copyright (C) 2006 Alexey Proskuryakov
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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 m_missingGlyphData.glyph = 0; 282 m_missingGlyphData.glyph = 0;
283 } 283 }
284 284
285 const SimpleFontData* SimpleFontData::fontDataForCharacter(UChar32) const { 285 const SimpleFontData* SimpleFontData::fontDataForCharacter(UChar32) const {
286 return this; 286 return this;
287 } 287 }
288 288
289 Glyph SimpleFontData::glyphForCharacter(UChar32 codepoint) const { 289 Glyph SimpleFontData::glyphForCharacter(UChar32 codepoint) const {
290 uint16_t glyph; 290 uint16_t glyph;
291 SkTypeface* typeface = platformData().typeface(); 291 SkTypeface* typeface = platformData().typeface();
292 RELEASE_ASSERT(typeface); 292 CHECK(typeface);
293 typeface->charsToGlyphs(&codepoint, SkTypeface::kUTF32_Encoding, &glyph, 1); 293 typeface->charsToGlyphs(&codepoint, SkTypeface::kUTF32_Encoding, &glyph, 1);
294 return glyph; 294 return glyph;
295 } 295 }
296 296
297 bool SimpleFontData::isSegmented() const { 297 bool SimpleFontData::isSegmented() const {
298 return false; 298 return false;
299 } 299 }
300 300
301 PassRefPtr<SimpleFontData> SimpleFontData::verticalRightOrientationFontData() 301 PassRefPtr<SimpleFontData> SimpleFontData::verticalRightOrientationFontData()
302 const { 302 const {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 float SimpleFontData::platformWidthForGlyph(Glyph glyph) const { 381 float SimpleFontData::platformWidthForGlyph(Glyph glyph) const {
382 if (!m_platformData.size()) 382 if (!m_platformData.size())
383 return 0; 383 return 0;
384 384
385 static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated."); 385 static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated.");
386 386
387 return SkiaTextMetrics(&m_paint).getSkiaWidthForGlyph(glyph); 387 return SkiaTextMetrics(&m_paint).getSkiaWidthForGlyph(glyph);
388 } 388 }
389 389
390 } // namespace blink 390 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698