• Stefan Zager's avatar
    Invalidate hit test data when a surface becomes active · 2336dd21
    Stefan Zager authored
    viz::HitTestManager::submit_hit_test_region_list_index_ is used to avoid
    sending hit test information to the browser if the underlying hit test
    data hasn't changed. It increments the index every time a new batch of
    hit test data arrives from a renderer process. However, there is another
    way that hit test data can be invalidated, requiring hit test data to
    be re-aggregated and sent to the browser:
    
    HitTestAggregator::Aggregate is not a simple pass-through for the data
    collected by HitTestManager. It also modifies flags on the hit test
    regions, based on whether or not a surface is active (see
    HitTestRegionFlags::kHitTestNotActive). "Active", in this case, does
    *not* mean that the surface has submitted a compositor frame. Rather,
    it means that the surface has submitted a compositor frame *and* the
    frame was included in the output of SurfaceAggregator::Aggregate. It is
    possible for a surface to change from inactive to active without
    triggering the re-aggregation of hit test data. In particular:
    
    - child surface submits a compositor frame with hit test data
    - SurfaceAggregator omits the child surface, because the parent surface
      has not yet reported bounds for the child surface.
    - HitTestAggregator marks the child surface's hit test regions as
      kHitTestNotActive.
    - parent surface submits a compositor frame with bounds for the child
      surface, but without new hit test data.
    
    In this situation, HitTestAggregator will never send new hit test data
    to the browser with updated flags for the child surface's regions.
    
    I have not seen this fail in the wild, but then again I don't generally
    pay attention to viz bugs. For the bug in question, I have a separate
    fix in blink; but that fix causes some changes in the order of data
    sent from the renderer to viz, which exacerbates this hit test data
    problem, causing failures in SitePerProcessHitTestBrowsertest.
    
    BUG=1033746
    
    Change-Id: Ic338ad64465a1427ed29017b20370b54ed747d76
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2044435
    Commit-Queue: Stefan Zager <szager@chromium.org>
    Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
    Reviewed-by: default avatarYi Gu <yigu@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#743307}
    2336dd21
frame_rate_decider_unittest.cc 10.2 KB