• Andres Calderon Jaramillo's avatar
    Add simple pixel test with multiple render passes. · 83286073
    Andres Calderon Jaramillo authored
    This CL creates a simple pixel test that does not rely on WebGL, canvas,
    or video and that results in multiple render passes.
    
    Motivation: https://crrev.com/c/1637737 broke Android compositing of
    some mixed WebGL/Canvas2D content. The root cause was an incorrect
    assumption in that CL: that when the framebuffer for the root render
    pass is bound, we wouldn't try to bind it again before swapping it. This
    assumption was wrong in the case of drawing a render pass quad onto the
    root render pass. See [1]. The aforementioned CL would call
    BeginSharedImageAccessDirectCHROMIUM() upon binding the root render
    pass' framebuffer and would call EndSharedImageAccessDirectCHROMIUM()
    only when the buffer is swapped. So, binding the framebuffer multiple
    times would result in the shared image system thinking that we wanted
    concurrent access to the SharedImage.
    
    When running some of the existing WebGL/Canvas2D pixel tests, I did see
    artifacts resulting from the wrong assumption, but they don't happen in
    all frames.
    
    The test in this CL reliably hits the issue. It's rendered using
    multiple render passes. The page is animated with JS to reliably
    reproduce the problem. I tried running the test before and after the
    revert of the bad CL (https://crrev.com/c/1963369). Before that revert,
    the test failed 20/20 times. After the revert the test succeeded 20/20
    times.
    
    For this test to catch the regression, it must run on Android Q.
    
    [1] https://cs.chromium.org/chromium/src/components/viz/service/display/gl_renderer.cc?l=1134-1136&rcl=64245a1d4d5484c33272c0fcb99731eff23b4103
    
    Bug: 958670,1033279
    Test: run locally on Pixel 2 w/ Android Q before/after CL:1963369.
    Change-Id: Id154e45814043e8a47d58b784df3b854b6036693
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1979059
    Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org>
    Reviewed-by: default avatarBrian Sheedy <bsheedy@chromium.org>
    Reviewed-by: default avatarEric Karl <ericrk@chromium.org>
    Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#733856}
    83286073
pixel_test_pages.py 55.2 KB