Commit 66da0224 authored by Philip Rogers's avatar Philip Rogers Committed by Commit Bot

Stop checking compositing in PaintLayer::GetBackgroundPaintLocation

PaintLayer::GetBackgroundPaintLocation returns a mask of where the
background should paint and is used for determining if composited
scrolling can occur at all through:
PaintLayerScrollableArea::ComputeNeedsCompositedScrolling.

If composited scrolling is not used, callsites handle not actually
painting onto the scrolling contents layer, see:
CompositedLayerMapping::UpdateBackgroundPaintsOntoScrollingContentsLayer

This patch breaks the dependency cycle introduced by [1]. Instead of
querying compositing state, this patch special-cases the root layer
so that kBackgroundPaintInScrollingContents can be returned even if
there is no overflow because the root layer creates scrolling contents
layers in this case.

[1] https://crrev.com/9e0775c12ad12

Bug: 835755
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I139f2f85c68d267de80c7b1e534a9fcef9af3983
Reviewed-on: https://chromium-review.googlesource.com/1042529Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555806}
parent bef61dcf
...@@ -2657,9 +2657,9 @@ GraphicsLayer* PaintLayer::GraphicsLayerBacking(const LayoutObject* obj) const { ...@@ -2657,9 +2657,9 @@ GraphicsLayer* PaintLayer::GraphicsLayerBacking(const LayoutObject* obj) const {
BackgroundPaintLocation PaintLayer::GetBackgroundPaintLocation( BackgroundPaintLocation PaintLayer::GetBackgroundPaintLocation(
uint32_t* reasons) const { uint32_t* reasons) const {
BackgroundPaintLocation location; BackgroundPaintLocation location;
bool has_scrolling_layers = bool may_have_scrolling_layers_without_scrolling =
scrollable_area_ && scrollable_area_->NeedsCompositedScrolling(); IsRootLayer() && RuntimeEnabledFeatures::RootLayerScrollingEnabled();
if (!ScrollsOverflow() && !has_scrolling_layers) { if (!ScrollsOverflow() && !may_have_scrolling_layers_without_scrolling) {
location = kBackgroundPaintInGraphicsLayer; location = kBackgroundPaintInGraphicsLayer;
} else if (RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { } else if (RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
// If we care about LCD text, paint root backgrounds into scrolling contents // If we care about LCD text, paint root backgrounds into scrolling contents
......
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