[LayoutNG] Re-use line box fragments

This patch re-uses line box fragments where possible.

Overall approach is:
1. Line box NGPaintFragment is marked as dirty when modified.
   This was done in separate patches by yosin@, and is being
   improved further.
2. On the beginning of layout, if NGPaintFragment exists
   for the inline formatting context and re-using is
   possible, copy them to NGFragmentBuilder.
3. Setup the internal states and break token so that
   NGBlockLayoutAlgorithm can continue from the copied
   fragments.

This is very initial patch. Not much improvements are seen in
blink_perf.layout yet, but at this stage, the reuse is only
for very limited conditions, and I'm finding cases where we
mark dirty too much (fixing in parallel.)

Also some cases we're slowing down, due to the overhead to
check the reusability but ended up with no reuse. The code
to check is also target to be profiled for more optimizations.

Bug: 636993
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ib0f24ece25bf666f67042a915ed75e0b5d2b4356
Reviewed-on: https://chromium-review.googlesource.com/c/1196724
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604155}
15 files changed