Commit 71b78364 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[SPv175] Disable more code when PartialRasterInvalidation is not enabled

The code disabled in this CL had some side effects, e.g. left
PartialInvalidationRect not cleared after PrePaintClean, and the next
document lifecycle might do unexpected rect mapping while no
NeedsVisualRect flag set.

Bug: 836097
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ib05ccfd439be78666771f8483a0b462128848c08
Reviewed-on: https://chromium-review.googlesource.com/1041570Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555889}
parent d7a705f1
......@@ -3809,7 +3809,8 @@ void LayoutObject::ClearPaintInvalidationFlags() {
#if DCHECK_IS_ON()
DCHECK(!ShouldCheckForPaintInvalidation() || PaintInvalidationStateIsDirty());
#endif
if (!RuntimeEnabledFeatures::SlimmingPaintV175Enabled())
if (!RuntimeEnabledFeatures::SlimmingPaintV175Enabled() ||
!RuntimeEnabledFeatures::PartialRasterInvalidationEnabled())
fragment_.SetPartialInvalidationRect(LayoutRect());
ClearShouldDoFullPaintInvalidation();
......
......@@ -533,10 +533,12 @@ void ObjectPaintInvalidatorWithContext::InvalidateSelection(
return;
if (RuntimeEnabledFeatures::SlimmingPaintV175Enabled()) {
if (RuntimeEnabledFeatures::PartialRasterInvalidationEnabled()) {
// PaintController will handle raster invalidation of the partial rect.
object_.GetMutableForPainting().SetPartialInvalidationRect(
UnionRect(object_.PartialInvalidationRect(),
UnionRect(new_selection_rect, old_selection_rect)));
}
} else {
FullyInvalidatePaint(PaintInvalidationReason::kSelection,
old_selection_rect, new_selection_rect);
......@@ -555,13 +557,18 @@ void ObjectPaintInvalidatorWithContext::InvalidatePartialRect(
if (rect.IsEmpty())
return;
if (!RuntimeEnabledFeatures::SlimmingPaintV175Enabled() ||
RuntimeEnabledFeatures::PartialRasterInvalidationEnabled()) {
context_.MapLocalRectToVisualRectInBacking(object_, rect);
if (rect.IsEmpty())
return;
}
if (RuntimeEnabledFeatures::SlimmingPaintV175Enabled()) {
if (RuntimeEnabledFeatures::PartialRasterInvalidationEnabled()) {
// PaintController will handle raster invalidation of the partial rect.
object_.GetMutableForPainting().SetPartialInvalidationRect(rect);
}
} else {
InvalidatePaintRectangleWithContext(rect,
PaintInvalidationReason::kRectangle);
......
......@@ -281,6 +281,10 @@ TEST_F(ObjectPaintInvalidatorTest, InvalidatePaintRectangle) {
EXPECT_EQ(LayoutRect(10, 10, 80, 80), target->PartialInvalidationRect());
EXPECT_TRUE(target->MayNeedPaintInvalidation());
GetDocument().View()->UpdateLifecycleToPrePaintClean();
if (!RuntimeEnabledFeatures::SlimmingPaintV175Enabled() ||
!RuntimeEnabledFeatures::PartialRasterInvalidationEnabled())
EXPECT_EQ(LayoutRect(), target->PartialInvalidationRect());
GetDocument().View()->UpdateAllLifecyclePhases();
EXPECT_EQ(LayoutRect(), target->PartialInvalidationRect());
......
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