Commit 2abbe360 authored by Yoichi Osato's avatar Yoichi Osato Committed by Commit Bot

Skip invalidation rect update if empty

At ObjectPaintInvalidatorWithContext::InvalidateSelection we update PartialInvalidationVisualRect
even if the union rect of old and new selection rect is empty.

This patch skips the update if the union rect is empty.


Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I11dd813381b4fd5be69d4357e816d9c64cdb17ba
Reviewed-on: https://chromium-review.googlesource.com/1183011Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585346}
parent 3813b7b3
...@@ -322,9 +322,13 @@ PaintInvalidationReason ObjectPaintInvalidatorWithContext::InvalidateSelection( ...@@ -322,9 +322,13 @@ PaintInvalidationReason ObjectPaintInvalidatorWithContext::InvalidateSelection(
if (full_invalidation) if (full_invalidation)
return reason; return reason;
const LayoutRect invalidation_rect =
UnionRect(new_selection_rect, old_selection_rect);
if (invalidation_rect.IsEmpty())
return reason;
object_.GetMutableForPainting().SetPartialInvalidationVisualRect( object_.GetMutableForPainting().SetPartialInvalidationVisualRect(
UnionRect(object_.PartialInvalidationVisualRect(), UnionRect(object_.PartialInvalidationVisualRect(), invalidation_rect));
UnionRect(new_selection_rect, old_selection_rect)));
return PaintInvalidationReason::kSelection; return PaintInvalidationReason::kSelection;
} }
......
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