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

Rasterize URL bar exposed region only when scrolling

When the URL bar is being actively scrolled out of view, the browser is
exposing a new region of the page at the bottom of the screen. Since the
render/Blink hasn't been resized yet, PictureLayerImpl has some code to
rasterize this new region despite the fact it falls outside the layer's
bounds.

As part of https://crrev.com/77b67445ba6e415e8b41b5b6fd5c016c7195206d, I
changed this code to raster the exact amount the URL bar is hidden.
However, this caused a perf regression as we would now raster the region
in pieces as the URL bar scrolled away, rather than in one go.

So in https://crrev.com/b2d410710e7ea7c5a33798ff6b5d5191b1951b5e I undid
that change and rastered the entire region as before. However, I kept
some the other changes made in the first CL. One of those changes was to
do this only when browser_controls_shrink_blink_size is true (meaning the
renderer has received a resize as a result of the URL bar being shown)
but no longer look if we're in an active scroll. Not looking at whether
we're actively scrolling regresses the metric in the linked bug.

It's more correct to look at both these bits. We should only expand the
raster region when we're going from controls shown to hidden (so look at
browser_controls_shrink_blink_size) but we should also only do this when
we're in a scroll. i.e. If the user isn't hiding the URL bar, there's no
need to raster additional content.

Bug: 900928
Change-Id: I373ebe8879b832616780996f9afdd16092538fdd
Reviewed-on: https://chromium-review.googlesource.com/c/1315699Reviewed-by: default avatarenne <enne@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605476}
parent 1bfe9be8
......@@ -720,6 +720,7 @@ void PictureLayerImpl::UpdateViewportRectForTilePriorityInContentSpace() {
// can cause activation flickering issues. So, if we're in this situation
// adjust the visible rect by the the controls height.
if (layer_tree_impl()->IsPendingTree() &&
layer_tree_impl()->IsActivelyScrolling() &&
layer_tree_impl()->browser_controls_shrink_blink_size()) {
viewport_rect_for_tile_priority_in_content_space_.Inset(
0, // left
......
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