dpy_gfx_switch_surface is used to ask each valid DisplayChangeListener of a QemuConsole to switch to another DisplaySurface.
Signed-off-by: Tina Zhang <tina.zh...@intel.com> --- include/ui/console.h | 2 ++ ui/console.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/ui/console.h b/include/ui/console.h index 37a8d68..434033d 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -293,6 +293,8 @@ int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info); void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h); void dpy_gfx_replace_surface(QemuConsole *con, DisplaySurface *surface); +void dpy_gfx_switch_surface(QemuConsole *con, + DisplaySurface *surface); void dpy_text_cursor(QemuConsole *con, int x, int y); void dpy_text_update(QemuConsole *con, int x, int y, int w, int h); void dpy_text_resize(QemuConsole *con, int w, int h); diff --git a/ui/console.c b/ui/console.c index 3fb2f4e..2deb38b 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1595,6 +1595,22 @@ void dpy_gfx_replace_surface(QemuConsole *con, qemu_free_displaysurface(old_surface); } +void dpy_gfx_switch_surface(QemuConsole *con, + DisplaySurface *surface) +{ + DisplayState *s = con->ds; + DisplayChangeListener *dcl; + + QLIST_FOREACH(dcl, &s->listeners, next) { + if (con != (dcl->con ? dcl->con : active_console)) { + continue; + } + if (dcl->ops->dpy_gfx_switch) { + dcl->ops->dpy_gfx_switch(dcl, surface); + } + } +} + bool dpy_gfx_check_format(QemuConsole *con, pixman_format_code_t format) { -- 2.7.4