Implement safe-to-break for ShapingLineBreaker

Desktop / Chromium - Emil A Eklund [chromium.org] - 8 September 2017 19:43 EDT

Compute offsets where line breaks may occur without requiring re-shaping of the two sides by checking the HarfBuzz UNSAFE_TO_BREAK flag and store all such suitable offsets in the new safe_to_break vector on the RunInfo struct for each run in a ShapeResult.

This allows for faster and higher quality line breaking as only suitable breaking positions are considered candidates for line breaking if at all possible. Only re-shapes if a line has no suitable safe-to-break offset.

Change-Id: Iaa43079152e3c9b42662877f9821c5c125f7bafe Reviewed-on: https://chromium-review.googlesource.com/614766 Commit-Queue: Emil A Eklund

d5840e2 Implement safe-to-break for ShapingLineBreaker
third_party/WebKit/LayoutTests/TestExpectations | 1 +
.../platform/fonts/shaping/HarfBuzzShaperTest.cpp | 173 +++++++++++++++++++++
.../Source/platform/fonts/shaping/ShapeResult.cpp | 120 +++++++++++++-
.../Source/platform/fonts/shaping/ShapeResult.h | 5 +
.../fonts/shaping/ShapeResultInlineHeaders.h | 11 ++
.../platform/fonts/shaping/ShapingLineBreaker.cpp | 47 ++----
.../fonts/shaping/ShapingLineBreakerTest.cpp | 4 +-
.../Source/platform/testing/FontTestHelpers.cpp | 6 +-
.../Source/platform/testing/FontTestHelpers.h | 4 +-
.../third_party/MEgalopolis/MEgalopolisExtra.woff | Bin 0 -> 43020 bytes
.../testing/data/third_party/MEgalopolis/README | 37 +++++
11 files changed, 362 insertions(+), 46 deletions(-)

Upstream: git.chromium.org


  • Share