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

Side by Side Diff: Source/WebCore/platform/graphics/chromium/ComplexTextControllerLinux.cpp

Issue 6471009: Merge 76732 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 10 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
« no previous file with comments | « Source/WebCore/platform/graphics/chromium/ComplexTextControllerLinux.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 Google Inc. All rights reserved. 2 * Copyright (c) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 void ComplexTextController::reset(unsigned offset) 139 void ComplexTextController::reset(unsigned offset)
140 { 140 {
141 m_indexOfNextScriptRun = 0; 141 m_indexOfNextScriptRun = 0;
142 m_offsetX = offset; 142 m_offsetX = offset;
143 } 143 }
144 144
145 // Advance to the next script run, returning false when the end of the 145 // Advance to the next script run, returning false when the end of the
146 // TextRun has been reached. 146 // TextRun has been reached.
147 bool ComplexTextController::nextScriptRun() 147 bool ComplexTextController::nextScriptRun()
148 { 148 {
149 if (!hb_utf16_script_run_next(&m_numCodePoints, &m_item.item, m_run.characte rs(), m_run.length(), &m_indexOfNextScriptRun)) 149 if (!hb_utf16_script_run_next(0, &m_item.item, m_run.characters(), m_run.len gth(), &m_indexOfNextScriptRun))
150 return false; 150 return false;
151 151
152 // It is actually wrong to consider script runs at all in this code. 152 // It is actually wrong to consider script runs at all in this code.
153 // Other WebKit code (e.g. Mac) segments complex text just by finding 153 // Other WebKit code (e.g. Mac) segments complex text just by finding
154 // the longest span of text covered by a single font. 154 // the longest span of text covered by a single font.
155 // But we currently need to call hb_utf16_script_run_next anyway to fill 155 // But we currently need to call hb_utf16_script_run_next anyway to fill
156 // in the harfbuzz data structures to e.g. pick the correct script's shaper. 156 // in the harfbuzz data structures to e.g. pick the correct script's shaper.
157 // So we allow that to run first, then do a second pass over the range it 157 // So we allow that to run first, then do a second pass over the range it
158 // found and take the largest subregion that stays within a single font. 158 // found and take the largest subregion that stays within a single font.
159 m_currentFontData = m_font->glyphDataForCharacter(m_item.string[m_item.item. pos], false).fontData; 159 m_currentFontData = m_font->glyphDataForCharacter(m_item.string[m_item.item. pos], false).fontData;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 normalizedBuffer.set(new UChar[normalizedBufferLength + 1]); 372 normalizedBuffer.set(new UChar[normalizedBufferLength + 1]);
373 373
374 normalizeSpacesAndMirrorChars(sourceText, originalRun.rtl(), normalizedBuffe r.get(), normalizedBufferLength); 374 normalizeSpacesAndMirrorChars(sourceText, originalRun.rtl(), normalizedBuffe r.get(), normalizedBufferLength);
375 375
376 normalizedRun.set(new TextRun(originalRun)); 376 normalizedRun.set(new TextRun(originalRun));
377 normalizedRun->setText(normalizedBuffer.get(), normalizedBufferLength); 377 normalizedRun->setText(normalizedBuffer.get(), normalizedBufferLength);
378 return *normalizedRun; 378 return *normalizedRun;
379 } 379 }
380 380
381 } // namespace WebCore 381 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/platform/graphics/chromium/ComplexTextControllerLinux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698