harfbuzz shaper should not modify character-clustering info due to diacritic within ligature. Bug 249159, r=smontagu
authorJonathan Kew <jfkthame@gmail.com>
Mon, 07 May 2012 12:18:24 -0700
changeset 93404 1dbfff7cf0ab8fd028d32a754b9aafefc7481a95
parent 93403 863fe7093e304ab0e92a1cf4f8bacdb721358e0f
child 93405 e763ef9f3d5d08b01168a6db2ddab4d6f839db89
push id22634
push useremorley@mozilla.com
push dateTue, 08 May 2012 09:48:43 +0000
treeherdermozilla-central@e4f9e2eab6b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmontagu
bugs249159
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
harfbuzz shaper should not modify character-clustering info due to diacritic within ligature. Bug 249159, r=smontagu
gfx/thebes/gfxHarfBuzzShaper.cpp
--- a/gfx/thebes/gfxHarfBuzzShaper.cpp
+++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
@@ -1182,17 +1182,16 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(gfxC
     // keep track of y-position to set glyph offsets if needed
     nscoord yPos = 0;
 
     const hb_glyph_position_t *posInfo =
         hb_buffer_get_glyph_positions(aBuffer, nsnull);
 
     while (glyphStart < PRInt32(numGlyphs)) {
 
-        bool inOrder = true;
         PRInt32 charEnd = ginfo[glyphStart].cluster;
         PRInt32 glyphEnd = glyphStart;
         PRInt32 charLimit = wordLength;
         while (charEnd < charLimit) {
             // This is normally executed once for each iteration of the outer loop,
             // but in unusual cases where the character/glyph association is complex,
             // the initial character range might correspond to a non-contiguous
             // glyph range with "holes" in it. If so, we will repeat this loop to
@@ -1227,19 +1226,16 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(gfxC
             bool allGlyphsAreWithinCluster = true;
             PRInt32 prevGlyphCharIndex = charStart - 1;
             for (PRInt32 i = glyphStart; i < glyphEnd; ++i) {
                 PRInt32 glyphCharIndex = ginfo[i].cluster;
                 if (glyphCharIndex < charStart || glyphCharIndex >= charEnd) {
                     allGlyphsAreWithinCluster = false;
                     break;
                 }
-                if (glyphCharIndex <= prevGlyphCharIndex) {
-                    inOrder = false;
-                }
                 prevGlyphCharIndex = glyphCharIndex;
             }
             if (allGlyphsAreWithinCluster) {
                 break;
             }
         }
 
         NS_ASSERTION(glyphStart < glyphEnd,
@@ -1364,18 +1360,17 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(gfxC
             detailedGlyphs.Clear();
         }
 
         // the rest of the chars in the group are ligature continuations,
         // no associated glyphs
         while (++baseCharIndex != endCharIndex &&
                baseCharIndex < PRInt32(wordLength)) {
             gfxTextRun::CompressedGlyph g;
-            g.SetComplex(inOrder &&
-                         aShapedWord->IsClusterStart(baseCharIndex),
+            g.SetComplex(aShapedWord->IsClusterStart(baseCharIndex),
                          false, 0);
             aShapedWord->SetGlyphs(baseCharIndex, g, nsnull);
         }
 
         glyphStart = glyphEnd;
         charStart = charEnd;
     }