[LayoutNG] Implement ShapeResult::CopyRanges

Add new CopyRanges method to ShapeResult for batch processing sequential
ranges without the need to iterate over runs to determine start boundary
for each range.

This replaces the OpaqueContext parameter in CopyRange which implemented
a similar optimization, with a worse API, and limited to certain left to
right runs. Updates the LayoutNG shaping logic to use the new API during
item construction and paragraph level shaping for both LTR and RTL text.

Test: renderer/platform/fonts/shaping/shape_result_test.cc
Bug: 923962
Change-Id: I34912fb8821106da733c605585c33de01d28f3d7
Reviewed-on: https://chromium-review.googlesource.com/c/1474837
Commit-Queue: Koji Ishii <kojii@chromium.org>
Auto-Submit: Emil A Eklund <eae@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632975}
13 files changed