Commit 41b2061a authored by David Bokan's avatar David Bokan Committed by Commit Bot

Update compositing inputs on scrolling root layer

Layers need to be checked for paint order and overlap with
composited layers to determine if they too must be composited.
This is called overlap testing and happens in a compositing update
if the compositing inputs are marked as dirty.

Scrolling normally doesn't dirty compositing inputs but viewport
scrolling is special if it has fixed layers. This is because
scrolling the viewport can change what fixed layers overlap,
unlike other content on the page which scrolls together.

Before root-layer-scrolling, the LocalFrameView would do this in
LocalFrameView::UpdateLayersAndCompositingAfterScrollIfNeeded.
With root-layer-scrolling, the top PaintLayerScrollableArea handles
viewport scrolling. This patch simply copies that behavior from
LocalFrameView to PaintLayerScrollableArea.

Bug: 776969
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I0cc6062caded3c42eb0febb48c391a1fe4af54bf
Reviewed-on: https://chromium-review.googlesource.com/754346Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518444}
parent 3c626e8b
crbug.com/417782 compositing/iframes/become-composited-nested-iframes.html [ Failure ] crbug.com/417782 compositing/iframes/become-composited-nested-iframes.html [ Failure ]
crbug.com/417782 compositing/iframes/invisible-nested-iframe-show.html [ Failure ] crbug.com/417782 compositing/iframes/invisible-nested-iframe-show.html [ Failure ]
crbug.com/417782 compositing/iframes/overlapped-iframe-iframe.html [ Failure ] crbug.com/417782 compositing/iframes/overlapped-iframe-iframe.html [ Failure ]
crbug.com/417782 compositing/iframes/overlapped-nested-iframes.html [ Failure ]
crbug.com/417782 compositing/layer-creation/iframe-background-attachment-fixed.html [ Failure ] crbug.com/417782 compositing/layer-creation/iframe-background-attachment-fixed.html [ Failure ]
crbug.com/417782 compositing/rtl/rtl-iframe-absolute.html [ Failure ] crbug.com/417782 compositing/rtl/rtl-iframe-absolute.html [ Failure ]
crbug.com/417782 compositing/rtl/rtl-iframe-fixed.html [ Failure ] crbug.com/417782 compositing/rtl/rtl-iframe-fixed.html [ Failure ]
......
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [785, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [785, 1650],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF",
"transform": 1
},
{
"name": "LayoutIFrame IFRAME",
"position": [20, 150],
"bounds": [284, 204],
"transform": 1
},
{
"name": "LayoutView #document",
"position": [22, 152],
"bounds": [280, 200],
"transform": 1
},
{
"name": "Child Containment Layer",
"position": [22, 152],
"bounds": [280, 200],
"drawsContent": false,
"transform": 1
},
{
"name": "LayoutIFrame IFRAME",
"position": [30, 160],
"bounds": [252, 172],
"transform": 1
},
{
"name": "LayoutView #document",
"position": [31, 161],
"bounds": [250, 170],
"backgroundColor": "#C0C0C0",
"transform": 1
},
{
"name": "Child Containment Layer",
"position": [31, 161],
"bounds": [250, 170],
"drawsContent": false,
"transform": 1
},
{
"name": "LayoutBlockFlow DIV id='iframe-content' class='box'",
"bounds": [210, 210],
"contentsOpaque": true,
"backgroundColor": "#0000FF",
"transform": 2
},
{
"name": "LayoutIFrame IFRAME",
"position": [20, 374],
"bounds": [284, 204],
"transform": 1
},
{
"name": "LayoutView #document",
"position": [22, 376],
"bounds": [280, 200],
"transform": 1
},
{
"name": "Child Containment Layer",
"position": [22, 376],
"bounds": [280, 200],
"drawsContent": false,
"transform": 1
},
{
"name": "LayoutIFrame IFRAME",
"position": [30, 384],
"bounds": [252, 172],
"transform": 1
},
{
"name": "LayoutView #document",
"position": [31, 385],
"bounds": [250, 170],
"backgroundColor": "#C0C0C0",
"transform": 1
},
{
"name": "Child Containment Layer",
"position": [31, 385],
"bounds": [250, 170],
"drawsContent": false,
"transform": 1
},
{
"name": "LayoutBlockFlow DIV id='iframe-content' class='box'",
"bounds": [210, 210],
"contentsOpaque": true,
"backgroundColor": "#0000FF",
"transform": 3
},
{
"name": "LayoutBlockFlow (positioned) DIV id='banner'",
"position": [0, 100],
"bounds": [785, 120],
"backgroundColor": "#00000080",
"transform": 1
}
],
"transforms": [
{
"id": 1,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, -100, 0, 1]
],
"flattenInheritedTransform": false
},
{
"id": 2,
"parent": 1,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[49, 171, 0, 1]
]
},
{
"id": 3,
"parent": 1,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[49, 395, 0, 1]
]
}
]
}
...@@ -1918,16 +1918,29 @@ void PaintLayerScrollableArea::UpdateScrollableAreaSet() { ...@@ -1918,16 +1918,29 @@ void PaintLayerScrollableArea::UpdateScrollableAreaSet() {
void PaintLayerScrollableArea::UpdateCompositingLayersAfterScroll() { void PaintLayerScrollableArea::UpdateCompositingLayersAfterScroll() {
PaintLayerCompositor* compositor = Box().View()->Compositor(); PaintLayerCompositor* compositor = Box().View()->Compositor();
if (compositor->InCompositingMode()) { if (!compositor->InCompositingMode())
if (UsesCompositedScrolling()) { return;
DCHECK(Layer()->HasCompositedLayerMapping());
Layer()->GetCompositedLayerMapping()->SetNeedsGraphicsLayerUpdate( if (UsesCompositedScrolling()) {
kGraphicsLayerUpdateSubtree); DCHECK(Layer()->HasCompositedLayerMapping());
compositor->SetNeedsCompositingUpdate( Layer()->GetCompositedLayerMapping()->SetNeedsGraphicsLayerUpdate(
kCompositingUpdateAfterGeometryChange); kGraphicsLayerUpdateSubtree);
} else { compositor->SetNeedsCompositingUpdate(
Layer()->SetNeedsCompositingInputsUpdate(); kCompositingUpdateAfterGeometryChange);
// If we have fixed elements and we scroll the root layer in RLS we might
// change compositing since the fixed elements might now overlap a
// composited layer.
if (Layer()->IsRootLayer() &&
RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
LocalFrame* frame = Box().GetFrame();
if (frame && frame->View() &&
frame->View()->HasViewportConstrainedObjects()) {
Layer()->SetNeedsCompositingInputsUpdate();
}
} }
} else {
Layer()->SetNeedsCompositingInputsUpdate();
} }
} }
......
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