• Florin Malita's avatar
    Avoid unnecessary background image tiling · d46daceb
    Florin Malita authored
    Currently BackgroundImageGeometry computes a tiling geometry in the
    presence of borders.  This is correct, because (at least for
    background-origin: padding-box/content-box) backgrounds are repeated
    logically underneath the border.
    
    But if the border is opaque and fully obscures the background, these
    extra tiles are redundant.  What's more, tiling forces us to use
    image shaders for painting, unnecessarily.
    
    This CL introduces logic to minimize the background draw rect, and avoid
    unnecessary tiling for opaque borders.
    
    Also, because it is mostly used as an offset, replace box_outset with
    box_offset in BackgroundImageGeometry::Calculate.
    
    BUG=676636
    
    Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
    Change-Id: I6b7095036a197df104fb34422d33943f5901aa27
    Reviewed-on: https://chromium-review.googlesource.com/809229
    Commit-Queue: Florin Malita <fmalita@chromium.org>
    Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#522133}
    d46daceb