OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 Google Inc. All rights reserved. | 2 * Copyright (c) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. | 3 * Copyright (C) 2013 BlackBerry Limited. 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 are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * 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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 } | 892 } |
893 | 893 |
894 void HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun(HarfBuzzRun* currentRun, hb
_buffer_t* harfBuzzBuffer) | 894 void HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun(HarfBuzzRun* currentRun, hb
_buffer_t* harfBuzzBuffer) |
895 { | 895 { |
896 const SimpleFontData* currentFontData = currentRun->fontData(); | 896 const SimpleFontData* currentFontData = currentRun->fontData(); |
897 hb_glyph_info_t* glyphInfos = hb_buffer_get_glyph_infos(harfBuzzBuffer, 0); | 897 hb_glyph_info_t* glyphInfos = hb_buffer_get_glyph_infos(harfBuzzBuffer, 0); |
898 hb_glyph_position_t* glyphPositions = hb_buffer_get_glyph_positions(harfBuzz
Buffer, 0); | 898 hb_glyph_position_t* glyphPositions = hb_buffer_get_glyph_positions(harfBuzz
Buffer, 0); |
899 | 899 |
900 if (!currentRun->hasGlyphToCharacterIndexes()) { | 900 if (!currentRun->hasGlyphToCharacterIndexes()) { |
901 // FIXME: https://crbug.com/337886 | 901 // FIXME: https://crbug.com/337886 |
| 902 ASSERT_NOT_REACHED(); |
902 return; | 903 return; |
903 } | 904 } |
904 | 905 |
905 unsigned numGlyphs = currentRun->numGlyphs(); | 906 unsigned numGlyphs = currentRun->numGlyphs(); |
906 uint16_t* glyphToCharacterIndexes = currentRun->glyphToCharacterIndexes(); | 907 uint16_t* glyphToCharacterIndexes = currentRun->glyphToCharacterIndexes(); |
907 float totalAdvance = 0; | 908 float totalAdvance = 0; |
908 FloatPoint glyphOrigin; | 909 FloatPoint glyphOrigin; |
909 | 910 |
910 // HarfBuzz returns the shaping result in visual order. We need not to flip
for RTL. | 911 // HarfBuzz returns the shaping result in visual order. We need not to flip
for RTL. |
911 for (size_t i = 0; i < numGlyphs; ++i) { | 912 for (size_t i = 0; i < numGlyphs; ++i) { |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 point.x() + fromX, point.x() + toX, | 1147 point.x() + fromX, point.x() + toX, |
1147 point.y(), height); | 1148 point.y(), height); |
1148 } | 1149 } |
1149 | 1150 |
1150 return Font::pixelSnappedSelectionRect( | 1151 return Font::pixelSnappedSelectionRect( |
1151 point.x() + toX, point.x() + fromX, | 1152 point.x() + toX, point.x() + fromX, |
1152 point.y(), height); | 1153 point.y(), height); |
1153 } | 1154 } |
1154 | 1155 |
1155 } // namespace blink | 1156 } // namespace blink |
OLD | NEW |