Commit 965042c5 authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

[RLS] Remove the RootLayerScrollingEnabled check from FramePainter and PLSA.

Bug: 823365
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ia97f4fac5a0fd9929d8ff03b109057db7171e8f3
Reviewed-on: https://chromium-review.googlesource.com/1070621
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561331}
parent 73106f32
......@@ -43,18 +43,9 @@ void FramePainter::Paint(GraphicsContext& context,
GetFrameView().VisibleContentSize());
IntPoint content_offset =
-frame_view_location + GetFrameView().ScrollOffsetInt();
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() &&
!RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
auto content_cull_rect = rect;
content_cull_rect.UpdateForScrollingContents(
visible_area_without_scrollbars,
AffineTransform().Translate(-content_offset.X(), -content_offset.Y()));
document_dirty_rect = content_cull_rect.rect_;
} else {
document_dirty_rect = rect.rect_;
document_dirty_rect.Intersect(visible_area_without_scrollbars);
document_dirty_rect.MoveBy(content_offset);
}
document_dirty_rect = rect.rect_;
document_dirty_rect.Intersect(visible_area_without_scrollbars);
document_dirty_rect.MoveBy(content_offset);
bool should_paint_contents = !document_dirty_rect.IsEmpty();
bool should_paint_scrollbars = !GetFrameView().ScrollbarsSuppressed() &&
......@@ -75,28 +66,6 @@ void FramePainter::Paint(GraphicsContext& context,
GetFrameView().VisibleContentRect());
PaintContents(context, global_paint_flags, document_dirty_rect);
}
if (should_paint_scrollbars) {
DCHECK(!RuntimeEnabledFeatures::RootLayerScrollingEnabled());
IntRect scroll_view_dirty_rect = rect.rect_;
IntRect visible_area_with_scrollbars(
frame_view_location,
GetFrameView().VisibleContentSize(kIncludeScrollbars));
scroll_view_dirty_rect.Intersect(visible_area_with_scrollbars);
scroll_view_dirty_rect.MoveBy(-frame_view_location);
TransformRecorder transform_recorder(
context, *GetFrameView().GetLayoutView(),
AffineTransform::Translation(frame_view_location.X(),
frame_view_location.Y()));
ClipRecorder recorder(
context, *GetFrameView().GetLayoutView(),
DisplayItem::kClipFrameScrollbars,
IntRect(IntPoint(), visible_area_with_scrollbars.Size()));
PaintScrollbars(context, scroll_view_dirty_rect);
}
}
void FramePainter::PaintContents(GraphicsContext& context,
......
......@@ -492,13 +492,8 @@ void PaintLayerScrollableArea::UpdateScrollOffset(
InvalidatePaintForScrollOffsetChange(offset_was_zero);
// The scrollOffsetTranslation paint property depends on the scroll offset.
// (see: PaintPropertyTreeBuilder.updateProperties(LocalFrameView&,...) and
// PaintPropertyTreeBuilder.updateScrollAndScrollTranslation).
if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled() && is_root_layer) {
frame_view->SetNeedsPaintPropertyUpdate();
} else {
GetLayoutBox()->SetNeedsPaintPropertyUpdate();
}
// (see: PaintPropertyTreeBuilder::UpdateScrollAndScrollTranslation).
GetLayoutBox()->SetNeedsPaintPropertyUpdate();
// Schedule the scroll DOM event.
if (GetLayoutBox()->GetNode()) {
......@@ -864,13 +859,6 @@ int PaintLayerScrollableArea::PixelSnappedScrollHeight() const {
}
void PaintLayerScrollableArea::UpdateScrollOrigin() {
// LayoutView doesn't scroll when RLS is turned off so we should avoid
// changing the scroll origin in that case as it can affect coordinate
// conversions.
if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled() && GetLayoutBox() &&
GetLayoutBox()->IsLayoutView())
return;
// This should do nothing prior to first layout; the if-clause will catch
// that.
if (OverflowRect().IsEmpty())
......@@ -1164,9 +1152,7 @@ bool PaintLayerScrollableArea::HasVerticalOverflow() const {
// overflow. Currently, we need to avoid producing scrollbars here if they'll be
// handled externally in the RLC.
static bool CanHaveOverflowScrollbars(const LayoutBox& box) {
return (RuntimeEnabledFeatures::RootLayerScrollingEnabled() ||
!box.IsLayoutView()) &&
box.GetDocument().ViewportDefiningElement() != box.GetNode();
return box.GetDocument().ViewportDefiningElement() != box.GetNode();
}
void PaintLayerScrollableArea::UpdateAfterStyleChange(
......@@ -2156,11 +2142,10 @@ void PaintLayerScrollableArea::UpdateCompositingLayersAfterScroll() {
if (HasStickyDescendants())
InvalidateAllStickyConstraints();
// If we have fixed elements and we scroll the root layer in RLS we might
// If we have fixed elements and we scroll the root layer we might
// change compositing since the fixed elements might now overlap a
// composited layer.
if (Layer()->IsRootLayer() &&
RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
if (Layer()->IsRootLayer()) {
LocalFrame* frame = GetLayoutBox()->GetFrame();
if (frame && frame->View() &&
frame->View()->HasViewportConstrainedObjects()) {
......
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