[Lacros] Improve desktop screen/window capture efficiency
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:Greg Kerr <kerrnel@chromium.org> Reviewed-by:
Erik Chen <erikchen@chromium.org> Commit-Queue: Darin Fisher <darin@chromium.org> Cr-Commit-Position: refs/heads/master@{#814382}
Showing
This diff is collapsed.
Please register or sign in to comment