Commit 9e0775c1 authored by Steve Kobes's avatar Steve Kobes Committed by Commit Bot

Let backgrounds paint in scrolling contents layer without overflow.

Since r481209, the document creates composited scrolling layers with RLS even if
it doesn't overflow.  But PaintLayer::GetBackgroundPaintLocation didn't get the
memo.

Bug: 741858
Change-Id: I1fe09532eecc2bbd1b71c42e171bf86f4a893382
Reviewed-on: https://chromium-review.googlesource.com/570940Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Commit-Queue: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487557}
parent b650c38e
...@@ -2709,7 +2709,9 @@ GraphicsLayer* PaintLayer::GraphicsLayerBacking(const LayoutObject* obj) const { ...@@ -2709,7 +2709,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;
if (!ScrollsOverflow()) { bool has_scrolling_layers =
scrollable_area_ && scrollable_area_->NeedsCompositedScrolling();
if (!ScrollsOverflow() && !has_scrolling_layers) {
location = kBackgroundPaintInGraphicsLayer; location = kBackgroundPaintInGraphicsLayer;
} else if (RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { } else if (RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
location = GetLayoutObject().GetBackgroundPaintLocation(reasons); location = GetLayoutObject().GetBackgroundPaintLocation(reasons);
......
...@@ -77,8 +77,11 @@ void ViewPainter::PaintBoxDecorationBackground(const PaintInfo& paint_info) { ...@@ -77,8 +77,11 @@ void ViewPainter::PaintBoxDecorationBackground(const PaintInfo& paint_info) {
static_cast<const DisplayItemClient*>(layout_view_.Layer() static_cast<const DisplayItemClient*>(layout_view_.Layer()
->GetCompositedLayerMapping() ->GetCompositedLayerMapping()
->ScrollingContentsLayer()); ->ScrollingContentsLayer());
scroll_recorder.emplace(paint_info.context, layout_view_, paint_info.phase, if (!layout_view_.ScrolledContentOffset().IsZero()) {
layout_view_.ScrolledContentOffset()); scroll_recorder.emplace(paint_info.context, layout_view_,
paint_info.phase,
layout_view_.ScrolledContentOffset());
}
} }
if (DrawingRecorder::UseCachedDrawingIfPossible( if (DrawingRecorder::UseCachedDrawingIfPossible(
......
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