[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/19] vnc: add vnc_width+vnc_height helpers
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 11/19] vnc: add vnc_width+vnc_height helpers |
Date: |
Fri, 30 Oct 2015 12:10:06 +0100 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/vnc.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index cb1954c..283b93c 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -605,6 +605,17 @@ static void framebuffer_update_request(VncState *vs, int
incremental,
static void vnc_refresh(DisplayChangeListener *dcl);
static int vnc_refresh_server_surface(VncDisplay *vd);
+static int vnc_width(VncDisplay *vd)
+{
+ return MIN(VNC_MAX_WIDTH, ROUND_UP(surface_width(vd->ds),
+ VNC_DIRTY_PIXELS_PER_BIT));
+}
+
+static int vnc_height(VncDisplay *vd)
+{
+ return MIN(VNC_MAX_HEIGHT, surface_height(vd->ds));
+}
+
static void vnc_set_area_dirty(DECLARE_BITMAP(dirty[VNC_MAX_HEIGHT],
VNC_MAX_WIDTH / VNC_DIRTY_PIXELS_PER_BIT),
int width, int height,
@@ -715,9 +726,8 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
/* server surface */
qemu_pixman_image_unref(vd->server);
vd->ds = surface;
- width = MIN(VNC_MAX_WIDTH, ROUND_UP(surface_width(vd->ds),
- VNC_DIRTY_PIXELS_PER_BIT));
- height = MIN(VNC_MAX_HEIGHT, surface_height(vd->ds));
+ width = vnc_width(vd);
+ height = vnc_height(vd);
vd->server = pixman_image_create_bits(VNC_SERVER_FB_FORMAT,
width, height, NULL, 0);
--
1.8.3.1
- [Qemu-devel] [PATCH 02/19] buffer: add buffer_init, (continued)
- [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, 2015/10/30
- [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 <=
- [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
- Re: [Qemu-devel] [PATCH 00/19] buffer/vnc: improve vnc buffer hsndling, Daniel P. Berrange, 2015/10/30