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

Side by Side Diff: Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp

Issue 175253002: Switch to HarfBuzz on Mac and remove CoreText shaper (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fighting trunk TestExpectation changes Created 6 years, 2 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) 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
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();
903 return; 902 return;
904 } 903 }
905 904
906 unsigned numGlyphs = currentRun->numGlyphs(); 905 unsigned numGlyphs = currentRun->numGlyphs();
907 uint16_t* glyphToCharacterIndexes = currentRun->glyphToCharacterIndexes(); 906 uint16_t* glyphToCharacterIndexes = currentRun->glyphToCharacterIndexes();
908 float totalAdvance = 0; 907 float totalAdvance = 0;
909 FloatPoint glyphOrigin; 908 FloatPoint glyphOrigin;
910 909
911 // HarfBuzz returns the shaping result in visual order. We need not to flip for RTL. 910 // HarfBuzz returns the shaping result in visual order. We need not to flip for RTL.
912 for (size_t i = 0; i < numGlyphs; ++i) { 911 for (size_t i = 0; i < numGlyphs; ++i) {
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 point.x() + fromX, point.x() + toX, 1146 point.x() + fromX, point.x() + toX,
1148 point.y(), height); 1147 point.y(), height);
1149 } 1148 }
1150 1149
1151 return Font::pixelSnappedSelectionRect( 1150 return Font::pixelSnappedSelectionRect(
1152 point.x() + toX, point.x() + fromX, 1151 point.x() + toX, point.x() + fromX,
1153 point.y(), height); 1152 point.y(), height);
1154 } 1153 }
1155 1154
1156 } // namespace blink 1155 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/fonts/harfbuzz/HarfBuzzFaceCoreText.mm ('k') | Source/platform/fonts/mac/ComplexTextController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698