Commit b2d41071 authored by David Bokan's avatar David Bokan Committed by Commit Bot

Performance fix for top controls-affected raster

In https://crrev.com/77b67445ba6e415e8b41b5b6fd5c016c7195206d I changed
PictureLayerImpl::UpdateViewportRectForTilePriorityInContentSpace by the
"live" bounds-delta, which is the exact amount that the browser controls
have been hidden by. Prevoiusly, this method would expand by the entire
top controls height.

That CL caused the linked performance regression. I suspect this happens
because we would progressively raster slightly more of the layer, rather
than rastering the entire browser-controls based bar in one shot. This
CL goes back to expanding the visible rect by the entire
browser-controls height rather than using the amount-hidden.

Bug: 890870
Change-Id: Id3a2b019e394005fe4434b7b6bf4a37f81f4550c
Reviewed-on: https://chromium-review.googlesource.com/c/1297281Reviewed-by: default avatarvmpstr <vmpstr@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603130}
parent c04cd957
......@@ -718,19 +718,14 @@ void PictureLayerImpl::UpdateViewportRectForTilePriorityInContentSpace() {
// reflect the fact that we may be hiding the top or bottom controls. Thus,
// it would believe that the viewport is smaller than it actually is which
// can cause activation flickering issues. So, if we're in this situation
// adjust the visible rect by the amount the controls are expanded beyond
// the current viewport size (this is also called the "bounds delta" in
// LayerImpl and LTHI::UpdateViewportContainerBounds().
// adjust the visible rect by the the controls height.
if (layer_tree_impl()->IsPendingTree() &&
layer_tree_impl()->browser_controls_shrink_blink_size()) {
float hidden_ratio =
1.f - layer_tree_impl()->CurrentBrowserControlsShownRatio();
viewport_rect_for_tile_priority_in_content_space_.Inset(
0, // left
0, // top,
0, // right,
std::ceil(-total_controls_height * hidden_ratio)); // bottom
0, // left
0, // top,
0, // right,
-total_controls_height); // bottom
}
}
}
......
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