Use binary search in ShapeResult::InsertRun
Text shaping processes runs according to font fallback and produces out- of-sequence text runs. These runs then need to be sorted in visual order and that happens in ShapeResult::InsertRun by linearly scanning previous runs until the appropriate insert location is identified. This is rather slow and inefficient, especially for large blocks of plain text content. This patch replaces the linear scan with a more efficient binary search. Bug: 981518 Change-Id: I781c768a7f6d129c2998e725e9c889332eb43675 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1695756 Commit-Queue: Emil A Eklund <eae@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Reviewed-by:Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#676241}
Showing
Please register or sign in to comment