• Vasiliy Telezhnikov's avatar
    Reland "Limit access to gpu thread in DisplayResourceProvider" · 47b07852
    Vasiliy Telezhnikov authored
    This is a reland of d60e79d1
    
    The problem was that resources were never returned because
    ScopedBatchReturnResources was in outer scope than ScopedAllowGpuAccess
    so the state when we don't batch already, but still have access to gpu
    thread didn't exist.
    
    Solution to merge ScopedBatchReturnResources and ScopedAllowGpuAccess
    to make sure everything happens in right order.
    
    Original change's description:
    > Limit access to gpu thread in DisplayResourceProvider
    >
    > This CL makes sure that DisplayResourceProvider return resources only
    > when GPU Thread is available to make sure ReleaseImageContexts will
    > complete in finite time.
    >
    > This doesn't change anything for Chrome where GPU Thread is always
    > available, but on webview RenderThread that used for gpu access during
    > composition is available only during specific times (init, dtor,
    > DrawAndSwap)
    >
    > Bug: 1068716
    >
    > Change-Id: I8fa482ab7399d6ce7639c1d76187be86ce152059
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2138551
    > Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
    > Reviewed-by: Jonathan Backer <backer@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#757967}
    
    Bug: 1068716
    Change-Id: Idf531b9ee9e10057b571725a256d2af09efbea69
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2149377Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
    Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#759672}
    47b07852
display.cc 44.1 KB