[LayoutNG] Selection paint invalidation
In Pre-LayoutNG, selections are painted by LayoutText and LayoutReplaced. We record SelectionVisualRect in LayoutObject::FragmentData, and check for change of selection (in style and geometry) in ObjectPaintInvalidator::InvalidateSelection, update SelectionVisualRect and add needed invalidation rects into PartialInvalidationVisualRect. In LayoutNG, selections are mainly painted by NGPaintFragment. Now we keep track of NGPaintFragment's selection using NGPaintFragment::SelectionVisualRect, and invlaidate the NGPaintFragment if SelectionVisualRect changes. PaintInvalidationReason::kSelection is treated as a full invalidation reason for LayoutNG to simplify the logic (otherwise we need to support partial raster invalidation in NGPaintFragment which seems not worth it, with increased memory usage). This can be adjusted by the fact that we now have finer grain selection invalidation in LayoutNG (per NGPaintFragment) than Pre-LayoutNG (per LayoutObject). For selection style changes (::selection pseudo style), we simply invalidate the whole containing LayoutObject as the case is rare. Bug: 849112 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I7a04a12e8007fb4c2841e5db9b17f37b6d9e2580 Reviewed-on: https://chromium-review.googlesource.com/1084314 Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Reviewed-by:Yoshifumi Inoue <yosin@chromium.org> Reviewed-by:
Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/master@{#564717}
Showing
This diff is collapsed.
2.8 KB
3.83 KB