Bug 1200098 - patch 3 - Pass the gr_nobidi flag when shaping with graphite2, as we split text into unidirectional runs ahead of time. r=jdaggett
authorJonathan Kew <jkew@mozilla.com>
Fri, 11 Sep 2015 12:32:00 +0100
changeset 294588 ca6aca7378307f47d5807f4d40ad5f27cd67babf
parent 294587 66e7e47e3144da359a8d0e0e4ebfa4d12d33840a
child 294589 4e7857ca5bfad5fc41df3b192f983977fd14c545
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs1200098
milestone43.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
Bug 1200098 - patch 3 - Pass the gr_nobidi flag when shaping with graphite2, as we split text into unidirectional runs ahead of time. r=jdaggett
gfx/thebes/gfxGraphiteShaper.cpp
--- a/gfx/thebes/gfxGraphiteShaper.cpp
+++ b/gfx/thebes/gfxGraphiteShaper.cpp
@@ -160,19 +160,20 @@ gfxGraphiteShaper::ShapeText(gfxContext 
                       mFont->GetFontEntry()->FamilyName(),
                       mFallbackToSmallCaps,
                       AddFeature,
                       &f);
 
     size_t numChars = gr_count_unicode_characters(gr_utf16,
                                                   aText, aText + aLength,
                                                   nullptr);
+    gr_bidirtl grBidi = gr_bidirtl(aShapedText->IsRightToLeft()
+                                   ? (gr_rtl | gr_nobidi) : gr_nobidi);
     gr_segment *seg = gr_make_seg(mGrFont, mGrFace, 0, grFeatures,
-                                  gr_utf16, aText, numChars,
-                                  aShapedText->IsRightToLeft());
+                                  gr_utf16, aText, numChars, grBidi);
 
     gr_featureval_destroy(grFeatures);
 
     if (!seg) {
         return false;
     }
 
     nsresult rv = SetGlyphsFromSegment(aContext, aShapedText, aOffset, aLength,