• Dan Sanders's avatar
    [media] Reland: Fix video to canvas GPU-CPU race. · 1c700bea
    Dan Sanders authored
    VideoFrames marked with VideoFrameMetadata::READ_LOCK_FENCES_ENABLED
    must be retained until all reads have been completed. Such frames are
    produced when software frames are uploaded to GpuMemoryBuffers. The
    VideoResourceUpdater handles this, but PaintCanvasVideoRenderer
    implemented only sync tokens.
    
    As a result, WebGL reads of software-decoded frames can tear when the
    storage is reused for later frames.
    
    This CL adds a GL_COMMANDS_COMPLETED_CHROMIUM query after each potential
    VideoFrame read in PaintCanvasVideoRenderer, and retains a reference to
    the VideoFrame until it completes. This ensures that the memory is not
    reused until after the reads complete in the GPU process.
    
    TBR=pfeldman@chromium.org
    
    Bug: 819914
    Change-Id: Id181a476b78e2799bdbff149c9655427ae552743
    Reviewed-on: https://chromium-review.googlesource.com/1252962
    Commit-Queue: Dan Sanders <sandersd@chromium.org>
    Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
    Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#595676}
    1c700bea
devtools_eye_dropper.h 2.26 KB