[ozone/headless] Add initial display fetch support for headless
Each Ozone platform creates its own NativeDisplayDelegate to get display information. Otherwise, 'display::FakeDisplayDelegate' is used for NativeDisplayDelegate. Per bug, ozone headless is crashing because it uses FakeDisplayDelegate and it doesn't invoke OnConfigurationChanged before initialization completes so ScreenBase can't add the display. Once NativeDisplayDelegate is initialized, DesktopScreenOzone requires DisplayMode from DisplaySnapshot but FakeDisplayDelegate has FakeDisplaySnapshot and it doesn't have DisplayMode. This CL creates HeadlessNativeDisplayDelegate which owns DisplaySnapshot and DisplayMode for ozone/headless. DesktopScreenOzone keeps it in delegate_ and communicates with it. To try this, compile with the following gn args use_ozone = true ozone_platform_headless = true TEST=./out/Debug/chrome --ozone-platform=headless Bug: 851375 Change-Id: Ib0d6dc66e6d9c538db38e1c6f04c35b149f9b6e6 Reviewed-on: https://chromium-review.googlesource.com/1094851Reviewed-by:Robert Kroeger <rjkroege@chromium.org> Commit-Queue: Julie Jeongeun Kim <jkim@igalia.com> Cr-Commit-Position: refs/heads/master@{#567929}
Showing
Please register or sign in to comment