Commit 280f8b99 authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Refactor composite layer mapping to remove redundant conditional.

Bug: 872364
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ib45390dab6120e74d51564760433972f17dae9dc
Reviewed-on: https://chromium-review.googlesource.com/1167882Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582046}
parent 599aeebe
......@@ -529,10 +529,10 @@ bool ScrollingCoordinator::UpdateCompositedScrollOffset(
return true;
}
bool ScrollingCoordinator::ScrollableAreaScrollLayerDidChange(
void ScrollingCoordinator::ScrollableAreaScrollLayerDidChange(
ScrollableArea* scrollable_area) {
if (!page_ || !page_->MainFrame())
return false;
return;
UpdateUserInputScrollable(scrollable_area);
......@@ -615,7 +615,7 @@ bool ScrollingCoordinator::ScrollableAreaScrollLayerDidChange(
}
scrollable_area->LayerForScrollingDidChange(timeline);
return !!cc_layer;
return;
}
using GraphicsLayerHitTestRects =
......
......@@ -139,7 +139,7 @@ class CORE_EXPORT ScrollingCoordinator final
// blink uses a separate layer. To ensure the compositor scroll layer has the
// updated scroll container bounds, this needs to be called when the scrolling
// contents layer is resized.
bool ScrollableAreaScrollLayerDidChange(ScrollableArea*);
void ScrollableAreaScrollLayerDidChange(ScrollableArea*);
void ScrollableAreaScrollbarLayerDidChange(ScrollableArea*,
ScrollbarOrientation);
void UpdateLayerPositionConstraint(PaintLayer*);
......
......@@ -1675,17 +1675,9 @@ void CompositedLayerMapping::UpdateScrollingLayerGeometry(
if (scrolling_contents_offset != scrolling_contents_offset_ ||
scroll_size != scrolling_contents_layer_->Size() ||
scroll_container_size_changed) {
bool coordinator_handles_offset = false;
auto* scrolling_coordinator = owning_layer_.GetScrollingCoordinator();
auto* scrollable_area = owning_layer_.GetScrollableArea();
if (scrolling_coordinator && scrollable_area) {
coordinator_handles_offset =
scrolling_coordinator->ScrollableAreaScrollLayerDidChange(
scrollable_area);
}
scrolling_contents_layer_->SetPosition(
coordinator_handles_offset ? FloatPoint()
: FloatPoint(-ToFloatSize(scroll_position)));
scrolling_coordinator->ScrollableAreaScrollLayerDidChange(scrollable_area);
scrolling_contents_layer_->SetPosition(FloatPoint());
}
scrolling_contents_offset_ = scrolling_contents_offset;
......
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