crosvm/gpu_display/examples/simple.rs
Zach Reizner f5285c647a gpu_display: add X11 backend
This change adds an X11 backend to the gpu_display crate. With this
addition, the virtio-gpu device can display to traditional linux
desktops that only have X11 output.

Change-Id: I86c80cac91ca5bdc97588194a44040273ae69385
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1591572
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Auto-Submit: Zach Reizner <zachr@chromium.org>
2019-07-25 22:15:48 +00:00

15 lines
481 B
Rust

// Copyright 2019 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use gpu_display::*;
fn main() {
let mut disp = GpuDisplay::open_wayland(None::<&str>).unwrap();
let surface_id = disp.create_surface(None, 1280, 1024).unwrap();
disp.flip(surface_id);
disp.commit(surface_id);
while !disp.close_requested(surface_id) {
disp.dispatch_events();
}
}