Pre-compute start/end index for ShapeResult

The methods for computing start and end index for a shape result compute
the values on demand, while not too expensive these methods are called a
lot during both layout and paint. By pre-computing the values text paint
performance is improved by about 10% for LayoutNG & about 2% for legacy.

Bug: 714962
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: Ib652b947d6cc670e657d72d753e96ecb4e2aa85d
Reviewed-on: https://chromium-review.googlesource.com/1176202
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584335}
2 files changed