12012-07-26 Kenichi Ishibashi <bashi@chromium.org>
2
3 [Chromium] HarfBuzzShaper can't handle segmented text run
4 https://bugs.webkit.org/show_bug.cgi?id=92445
5
6 Reviewed by NOBODY (OOPS!).
7
8 Pass the range to be displayed to HarfBuzzShaper. The shaper calculates positions and advances of each glyph
9 regardless of the range, but only add glyphs which are in the range.
10
11 No new tests. platform/chromium-linux/fast/text/international/draw-complex-text-from-to.html should
12 work as expected once we move to use harfbuzz-ng on linux. Note that the current expectation will need to be rebaselined
13 because the old hb shaper (ComplexTextController) mishandles the range. |to| should be exclusive. I'll rebaseline
14 the expectation later.
15
16 * platform/graphics/harfbuzz/FontHarfBuzz.cpp:
17 (WebCore::Font::drawComplexText): Call shaper.setDrawRange().
18 * platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp:
19 (WebCore::HarfBuzzShaper::HarfBuzzShaper):
20 (WebCore::HarfBuzzShaper::setDrawRange): Added.
21 (WebCore):
22 (WebCore::HarfBuzzShaper::shouldDrawCharacter): Added.
23 (WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Added variables that hold pending advances.
24 (WebCore::HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun): Add only glyphs which are in the given range to glyphBuffer.
25 * platform/graphics/harfbuzz/ng/HarfBuzzShaper.h:
26 (HarfBuzzShaper):
27 * platform/graphics/mac/FontComplexTextMac.cpp:
28 (WebCore::Font::drawComplexText): Call shaper.setDrawRange().
29