• Julie Jeongeun Kim's avatar
    [ozone/headless] Add initial display fetch support for headless · 7dbf2eae
    Julie Jeongeun Kim authored
    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: I2c097bf54fafb2d9311919647801e401c59ba929
    Reviewed-on: https://chromium-review.googlesource.com/1120447
    Commit-Queue: Julie Jeongeun Kim <jkim@igalia.com>
    Reviewed-by: default avatarMichael Spang <spang@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#572488}
    7dbf2eae
BUILD.gn 1.07 KB