OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |