• David Bokan's avatar
    Rasterize URL bar exposed region only when scrolling · e799978a
    David Bokan authored
    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}
    e799978a
picture_layer_impl.cc 71.9 KB