Commit 1fde0aa3 authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

[PE] Don't invalidate compositing inputs on scroll.

An earlier patch (http://crrev.com/582337) regressed this.

Bug: 873883

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ie5fe1149ac1da2df7c1a59864339f5b5982527ff
Reviewed-on: https://chromium-review.googlesource.com/1183596
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: default avatarvmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585128}
parent 7af35811
...@@ -324,7 +324,8 @@ void PaintLayer::UpdateLayerPositionsAfterLayout() { ...@@ -324,7 +324,8 @@ void PaintLayer::UpdateLayerPositionsAfterLayout() {
} }
void PaintLayer::UpdateLayerPositionRecursive( void PaintLayer::UpdateLayerPositionRecursive(
UpdateLayerPositionBehavior behavior) { UpdateLayerPositionBehavior behavior,
bool dirty_compositing_if_needed) {
LayoutPoint old_location = location_; LayoutPoint old_location = location_;
switch (behavior) { switch (behavior) {
case AllLayers: case AllLayers:
...@@ -342,7 +343,7 @@ void PaintLayer::UpdateLayerPositionRecursive( ...@@ -342,7 +343,7 @@ void PaintLayer::UpdateLayerPositionRecursive(
NOTREACHED(); NOTREACHED();
} }
if (location_ != old_location) if (dirty_compositing_if_needed && location_ != old_location)
SetNeedsCompositingInputsUpdate(); SetNeedsCompositingInputsUpdate();
for (PaintLayer* child = FirstChild(); child; child = child->NextSibling()) for (PaintLayer* child = FirstChild(); child; child = child->NextSibling())
...@@ -424,12 +425,14 @@ void PaintLayer::UpdateLayerPositionsAfterOverflowScroll() { ...@@ -424,12 +425,14 @@ void PaintLayer::UpdateLayerPositionsAfterOverflowScroll() {
// offset is not included in clip rects. Therefore, we do not need to clear // offset is not included in clip rects. Therefore, we do not need to clear
// them when that PaintLayer is scrolled. We also don't need to update layer // them when that PaintLayer is scrolled. We also don't need to update layer
// positions, because they also do not depend on the root's scroll offset. // positions, because they also do not depend on the root's scroll offset.
if (GetScrollableArea()->HasStickyDescendants()) if (GetScrollableArea()->HasStickyDescendants()) {
UpdateLayerPositionRecursive(OnlyStickyLayers); UpdateLayerPositionRecursive(OnlyStickyLayers,
/* dirty_compositing */ false);
}
return; return;
} }
ClearClipRects(); ClearClipRects();
UpdateLayerPositionRecursive(AllLayers); UpdateLayerPositionRecursive(AllLayers, /* dirty_compositing */ false);
} }
void PaintLayer::UpdateTransformationMatrix() { void PaintLayer::UpdateTransformationMatrix() {
......
...@@ -1103,7 +1103,8 @@ class CORE_EXPORT PaintLayer : public DisplayItemClient { ...@@ -1103,7 +1103,8 @@ class CORE_EXPORT PaintLayer : public DisplayItemClient {
bool HasOverflowControls() const; bool HasOverflowControls() const;
enum UpdateLayerPositionBehavior { AllLayers, OnlyStickyLayers }; enum UpdateLayerPositionBehavior { AllLayers, OnlyStickyLayers };
void UpdateLayerPositionRecursive(UpdateLayerPositionBehavior = AllLayers); void UpdateLayerPositionRecursive(UpdateLayerPositionBehavior = AllLayers,
bool dirty_compositing_if_needed = true);
void SetNextSibling(PaintLayer* next) { next_ = next; } void SetNextSibling(PaintLayer* next) { next_ = next; }
void SetPreviousSibling(PaintLayer* prev) { previous_ = prev; } void SetPreviousSibling(PaintLayer* prev) { previous_ = prev; }
......
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