• Darin Fisher's avatar
    [Lacros] Improve desktop screen/window capture efficiency · e559f2ca
    Darin Fisher authored
    Changes the interface to use SkBitmap, which is passed over Mojo IPC
    using BigBuffer (shared memory). This is then wrapped using a special
    subclass of webrtc::DesktopFrame (one less copy).
    
    There are still more copies than would be desirable here. We have the
    initial copy created by Ash. That is translated into a BigBuffer for
    transport over Mojo. That is then copied back to a SkBitmap. Avoiding
    those copies and even reusing the transport buffer are an exercise for
    a later CL.
    
    The interface design also unifies screen and window capture in a way
    that is consistent with webrtc::DesktopCapturer. This also enables a
    path to adding support for multiple screens in a future CL.
    
    There's a good deal of complexity in this CL to handle version skew.
    QueryVersion doesn't work synchronously, so a nested event loop is
    used on the background thread where DesktopCapturerLacros runs. That
    is safe, since this is a dedicated thread, but not ideal.
    
    The deprecated methods are re-implemented in terms of the newer
    interface.
    
    Bug: 1094460
    Change-Id: I2b2f86df08612b79faae7da547ff1242c05ac467
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2443404Reviewed-by: default avatarGreg Kerr <kerrnel@chromium.org>
    Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
    Commit-Queue: Darin Fisher <darin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#814382}
    e559f2ca
screen_manager.mojom 2.93 KB