console: rework DisplaySurface handling [dcl/ui side]

Replace the dpy_gfx_resize and dpy_gfx_setdata DisplayChangeListener
callbacks with a dpy_gfx_switch callback which notifies the ui code
when the framebuffer backing storage changes.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2013-02-28 15:03:04 +01:00
parent da229ef3b3
commit c12aeb860c
9 changed files with 43 additions and 55 deletions

View file

@ -367,7 +367,8 @@ void qemu_spice_display_update(SimpleSpiceDisplay *ssd,
qemu_spice_rect_union(&ssd->dirty, &update_area);
}
void qemu_spice_display_resize(SimpleSpiceDisplay *ssd)
void qemu_spice_display_switch(SimpleSpiceDisplay *ssd,
DisplaySurface *surface)
{
SimpleSpiceUpdate *update;
@ -589,11 +590,12 @@ static void display_update(DisplayChangeListener *dcl,
qemu_spice_display_update(ssd, x, y, w, h);
}
static void display_resize(DisplayChangeListener *dcl,
struct DisplayState *ds)
static void display_switch(DisplayChangeListener *dcl,
struct DisplayState *ds,
struct DisplaySurface *surface)
{
SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl);
qemu_spice_display_resize(ssd);
qemu_spice_display_switch(ssd, surface);
}
static void display_refresh(DisplayChangeListener *dcl,
@ -606,7 +608,7 @@ static void display_refresh(DisplayChangeListener *dcl,
static const DisplayChangeListenerOps display_listener_ops = {
.dpy_name = "spice",
.dpy_gfx_update = display_update,
.dpy_gfx_resize = display_resize,
.dpy_gfx_switch = display_switch,
.dpy_refresh = display_refresh,
};