Commit 46520ae1 authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

[PE] Stop dirtying compositing inputs on any layout for the root PaintLayer.

Instead, dirty them on particular PaintLayers only when their layout changed.

Bug: 410867
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Idf7664b869b1e7205e68adc075bcf828f279cffb
Reviewed-on: https://chromium-review.googlesource.com/1168142Reviewed-by: default avatarvmpstr <vmpstr@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582337}
parent 7363ebc0
......@@ -309,11 +309,6 @@ void PaintLayerCompositor::DidLayout() {
// isScrollable method would return a different value.
root_should_always_composite_dirty_ = true;
EnableCompositingModeIfNeeded();
// FIXME: Rather than marking the entire LayoutView as dirty, we should
// track which Layers moved during layout and only dirty those
// specific Layers.
RootLayer()->SetNeedsCompositingInputsUpdate();
}
#if DCHECK_IS_ON()
......
......@@ -325,6 +325,7 @@ void PaintLayer::UpdateLayerPositionsAfterLayout() {
void PaintLayer::UpdateLayerPositionRecursive(
UpdateLayerPositionBehavior behavior) {
LayoutPoint old_location = location_;
switch (behavior) {
case AllLayers:
UpdateLayerPosition();
......@@ -341,6 +342,9 @@ void PaintLayer::UpdateLayerPositionRecursive(
NOTREACHED();
}
if (location_ != old_location)
SetNeedsCompositingInputsUpdate();
for (PaintLayer* child = FirstChild(); child; child = child->NextSibling())
child->UpdateLayerPositionRecursive(behavior);
}
......@@ -925,6 +929,9 @@ bool PaintLayer::UpdateSize() {
} else if (LayoutBox* box = GetLayoutBox()) {
size_ = box->Size();
}
if (old_size != size_)
SetNeedsCompositingInputsUpdate();
return old_size != size_;
}
......@@ -3144,6 +3151,9 @@ void PaintLayer::StyleDidChange(StyleDifference diff,
SetNeedsCompositingInputsUpdate();
}
if (diff.NeedsLayout())
SetNeedsCompositingInputsUpdate();
// A scroller that changes background color might become opaque or not
// opaque, which in turn affects whether it can be composited on low-DPI
// screens.
......
......@@ -694,6 +694,7 @@ void PaintLayerScrollableArea::ContentsResized() {
ScrollableArea::ContentsResized();
// Need to update the bounds of the scroll property.
GetLayoutBox()->SetNeedsPaintPropertyUpdate();
Layer()->SetNeedsCompositingInputsUpdate();
}
IntPoint PaintLayerScrollableArea::LastKnownMousePosition() const {
......
......@@ -1805,6 +1805,9 @@ void FragmentPaintPropertyTreeBuilder::UpdateForObjectLocationAndSize(
object_.GetMutableForPainting().SetMayNeedPaintInvalidation();
fragment_data_.SetPaintOffset(context_.current.paint_offset);
fragment_data_.InvalidateClipPathCache();
object_.GetFrameView()->SetNeedsIntersectionObservation(
LocalFrameView::kDesired);
}
if (paint_offset_translation)
......
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