[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/19] vnc: factor out vnc_update_server_surface
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 12/19] vnc: factor out vnc_update_server_surface |
Date: |
Fri, 30 Oct 2015 12:10:07 +0100 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/vnc.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index 283b93c..61a8f2c 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -714,6 +714,17 @@ void *vnc_server_fb_ptr(VncDisplay *vd, int x, int y)
return ptr;
}
+static void vnc_update_server_surface(VncDisplay *vd)
+{
+ qemu_pixman_image_unref(vd->server);
+ vd->server = NULL;
+
+ vd->server = pixman_image_create_bits(VNC_SERVER_FB_FORMAT,
+ vnc_width(vd),
+ vnc_height(vd),
+ NULL, 0);
+}
+
static void vnc_dpy_switch(DisplayChangeListener *dcl,
DisplaySurface *surface)
{
@@ -722,19 +733,17 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
int width, height;
vnc_abort_display_jobs(vd);
-
- /* server surface */
- qemu_pixman_image_unref(vd->server);
vd->ds = surface;
- width = vnc_width(vd);
- height = vnc_height(vd);
- vd->server = pixman_image_create_bits(VNC_SERVER_FB_FORMAT,
- width, height, NULL, 0);
+
+ /* server surface */
+ vnc_update_server_surface(vd);
/* guest surface */
qemu_pixman_image_unref(vd->guest.fb);
vd->guest.fb = pixman_image_ref(surface->image);
vd->guest.format = surface->format;
+ width = vnc_width(vd);
+ height = vnc_height(vd);
memset(vd->guest.dirty, 0x00, sizeof(vd->guest.dirty));
vnc_set_area_dirty(vd->guest.dirty, width, height, 0, 0,
width, height);
--
1.8.3.1
- [Qemu-devel] [PATCH 17/19] buffer: factor out buffer_req_size, (continued)
- [Qemu-devel] [PATCH 17/19] buffer: factor out buffer_req_size, Gerd Hoffmann, 2015/10/30
- [Qemu-devel] [PATCH 07/19] vnc: attach names to buffers, Gerd Hoffmann, 2015/10/30
- [Qemu-devel] [PATCH 02/19] buffer: add buffer_init, Gerd Hoffmann, 2015/10/30
- [Qemu-devel] [PATCH 14/19] vnc: only alloc server surface with clients connected, Gerd Hoffmann, 2015/10/30
- [Qemu-devel] [PATCH 16/19] vnc: recycle empty vs->output buffer, Gerd Hoffmann, 2015/10/30
- [Qemu-devel] [PATCH 12/19] vnc: factor out vnc_update_server_surface,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 01/19] buffer: make the Buffer capacity increase in powers of two, Gerd Hoffmann, 2015/10/30
- [Qemu-devel] [PATCH 11/19] vnc: add vnc_width+vnc_height helpers, Gerd Hoffmann, 2015/10/30
- [Qemu-devel] [PATCH 15/19] vnc: fix local state init, Gerd Hoffmann, 2015/10/30
- [Qemu-devel] [PATCH 06/19] buffer: add tracing, Gerd Hoffmann, 2015/10/30
- [Qemu-devel] [PATCH 09/19] vnc-jobs: move buffer reset, use new buffer move, Gerd Hoffmann, 2015/10/30