[LayoutNG] Move run segmentation results out from NGInlineItem

This patch adds a new class, NGInlineItemSegment and
NGInlineItemSegments, to store run segmentation results.

They were stored in NGInlineItem before this patch, by
splitting them when an item has multiple runs. However, it
turned out that it is one of the biggest cause of the slow
performance on multi-native-scripts writing systems such as
Japanese.

The profile result of `japanese-kokoro-insert` indicates that
a block is split into 300 runs in average, and line breaking/
layout is slowed down by ~30% when compared to not to split
runs by scripts. This patch recovers most of the 30% by
moving it to NGInlineItemSegment.

ShapingLineBreaker is changed to accept a callback function
to reshape line edges so that it can utilize the cache from
NGInlineItem to RunSegmenterRange.

Bug: 636993
Change-Id: I8a7212400bdc5c8cae178f2d80729f8c7d35d416
Reviewed-on: https://chromium-review.googlesource.com/c/1358196
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614955}
23 files changed