Commit b88e1191 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

Refactor painting selection in NGTextFragmentPainter

This patch refactors painting selection, as a follow up to
the mid-ligature support in r750701 <crrev.com/c/2103968>:
1. Avoid calling |SelectionPaintingStyle| and a few other
   functions that are needed only when there is a selection,
   if there is no selection.
2. Collect logic to |SelectionPaintState|.
3. Eliminate |have_selection| and put all state variables
   to |Optional<SelectionPaintState>|.

This patch has no behavior changes.

Bug: 1025341, 982194
Change-Id: I1cd52d281c1191d19dd93f0657906733f3ea1af6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2108207Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751381}
parent 665132b2
......@@ -87,6 +87,9 @@ struct LayoutSelectionStatus {
: start(passed_start), end(passed_end), line_break(passed_line_break) {
DCHECK_LE(start, end);
}
bool HasValidRange() const { return start < end; }
bool operator==(const LayoutSelectionStatus& other) const {
return start == other.start && end == other.end &&
line_break == other.line_break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment