• liberato@chromium.org's avatar
    Send overlay promotion hints only to displayed resources. · 791f38e8
    liberato@chromium.org authored
    This change affects how overlays are chosen on Android.
    
    Previously, DisplayResourceProvider would notify all resources that
    requested a promotion hint, unless they were scheduled for deletion.
    The intent was that only the resources that are used for the current
    frame would receive hints.
    
    However, that no longer works.  The DisplayResourceProvider was
    sending hints to resources that weren't considered for overlay,
    such as resources used by a previous CompositorFrame.  The result
    was that the requestor would be told that the resource wasn't
    promotable, and would try to switch away from SurfaceView.  In
    reality, it just wasn't supposed to be on the screen.
    
    Instead, we now explicitly construct a list of resource IDs that are
    used by DrawQuads, and limit the hints to those.  We do this only
    if any resource (displayed or not) is requesting promotion hints,
    which should prevent the overlay processor from doing the extra
    work except when the results actually will be used.
    
    Bug: 900438
    Change-Id: Iba56e256b08233c9c05bd299d0ecd4a556807ccd
    Reviewed-on: https://chromium-review.googlesource.com/c/1310498
    Commit-Queue: Frank Liberato <liberato@chromium.org>
    Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#604655}
    791f38e8
overlay_candidate.cc 15.5 KB