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

Unified Diff: Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp

Issue 478823003: Shape across HarfBuzz runs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: w/o cache changes Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
diff --git a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
index 10abf5082fc7759397880cb6558c57d7499d309f..2ab156bca6d0e2bce142b9b51d23395077e9d6e9 100644
--- a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
+++ b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
@@ -636,7 +636,6 @@ static inline bool collectCandidateRuns(const UChar* normalizedBuffer,
const SimpleFontData* currentFontData = nextFontData;
UScriptCode currentScript = nextScript;
- UChar32 lastCharacter = character;
for (iterator.advance(clusterLength); iterator.consume(character, clusterLength); iterator.advance(clusterLength)) {
if (Character::treatAsZeroWidthSpace(character))
continue;
@@ -651,12 +650,9 @@ static inline bool collectCandidateRuns(const UChar* normalizedBuffer,
nextScript = uscript_getScript(character, &errorCode);
if (U_FAILURE(errorCode))
return false;
- if (lastCharacter == zeroWidthJoiner)
- currentFontData = nextFontData;
if ((nextFontData != currentFontData) || ((currentScript != nextScript) && (nextScript != USCRIPT_INHERITED) && (!uscript_hasScript(character, currentScript))))
break;
currentCharacterPosition = iterator.characters();
- lastCharacter = character;
}
CandidateRun run = { character, startIndexOfCurrentRun, iterator.currentCharacter(), currentFontData, currentScript };
@@ -861,11 +857,13 @@ bool HarfBuzzShaper::shapeHarfBuzzRuns()
hb_buffer_add_utf16(harfBuzzBuffer.get(), &preContext, 1, 1, 0);
if (fontDescription.variant() == FontVariantSmallCaps && u_islower(m_normalizedBuffer[currentRun->startIndex()])) {
- String upperText = String(m_normalizedBuffer.get() + currentRun->startIndex(), currentRun->numCharacters()).upper();
+ String upperText = String(m_normalizedBuffer.get(), m_normalizedBufferLength).upper();
ASSERT(!upperText.is8Bit()); // m_normalizedBuffer is 16 bit, therefore upperText is 16 bit, even after we call makeUpper().
- hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(upperText.characters16()), currentRun->numCharacters(), 0, currentRun->numCharacters());
+ hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(upperText.characters16()), currentRun->startIndex(), currentRun->startIndex(), 0);
+ hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(upperText.characters16() + currentRun->startIndex()), m_normalizedBufferLength - currentRun->startIndex(), 0, currentRun->numCharacters());
} else {
- hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(m_normalizedBuffer.get() + currentRun->startIndex()), currentRun->numCharacters(), 0, currentRun->numCharacters());
+ hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(m_normalizedBuffer.get()), currentRun->startIndex(), currentRun->startIndex(), 0);
+ hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(m_normalizedBuffer.get() + currentRun->startIndex()), m_normalizedBufferLength - currentRun->startIndex(), 0, currentRun->numCharacters());
}
if (fontDescription.orientation() == Vertical)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698