[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 13/19] vnc: use vnc_{width, height} in vnc_set_area_
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 13/19] vnc: use vnc_{width, height} in vnc_set_area_dirty |
Date: |
Fri, 30 Oct 2015 12:10:08 +0100 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/vnc.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index 61a8f2c..8ee1266 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -618,8 +618,12 @@ static int vnc_height(VncDisplay *vd)
static void vnc_set_area_dirty(DECLARE_BITMAP(dirty[VNC_MAX_HEIGHT],
VNC_MAX_WIDTH / VNC_DIRTY_PIXELS_PER_BIT),
- int width, int height,
- int x, int y, int w, int h) {
+ VncDisplay *vd,
+ int x, int y, int w, int h)
+{
+ int width = vnc_width(vd);
+ int height = vnc_height(vd);
+
/* this is needed this to ensure we updated all affected
* blocks if x % VNC_DIRTY_PIXELS_PER_BIT != 0 */
w += (x % VNC_DIRTY_PIXELS_PER_BIT);
@@ -641,10 +645,8 @@ static void vnc_dpy_update(DisplayChangeListener *dcl,
{
VncDisplay *vd = container_of(dcl, VncDisplay, dcl);
struct VncSurface *s = &vd->guest;
- int width = pixman_image_get_width(vd->server);
- int height = pixman_image_get_height(vd->server);
- vnc_set_area_dirty(s->dirty, width, height, x, y, w, h);
+ vnc_set_area_dirty(s->dirty, vd, x, y, w, h);
}
void vnc_framebuffer_update(VncState *vs, int x, int y, int w, int h,
@@ -745,7 +747,7 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
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,
+ vnc_set_area_dirty(vd->guest.dirty, vd, 0, 0,
width, height);
QTAILQ_FOREACH(vs, &vd->clients, next) {
@@ -755,7 +757,7 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
vnc_cursor_define(vs);
}
memset(vs->dirty, 0x00, sizeof(vs->dirty));
- vnc_set_area_dirty(vs->dirty, width, height, 0, 0,
+ vnc_set_area_dirty(vs->dirty, vd, 0, 0,
width, height);
}
}
@@ -2011,9 +2013,6 @@ static void ext_key_event(VncState *vs, int down,
static void framebuffer_update_request(VncState *vs, int incremental,
int x, int y, int w, int h)
{
- int width = pixman_image_get_width(vs->vd->server);
- int height = pixman_image_get_height(vs->vd->server);
-
vs->need_update = 1;
if (incremental) {
@@ -2021,7 +2020,7 @@ static void framebuffer_update_request(VncState *vs, int
incremental,
}
vs->force_update = 1;
- vnc_set_area_dirty(vs->dirty, width, height, x, y, w, h);
+ vnc_set_area_dirty(vs->dirty, vs->vd, x, y, w, h);
}
static void send_ext_key_event_ack(VncState *vs)
--
1.8.3.1
- Re: [Qemu-devel] [PATCH 05/19] buffer: add buffer_shrink, (continued)
- [Qemu-devel] [PATCH 04/19] buffer: add buffer_move, Gerd Hoffmann, 2015/10/30
- [Qemu-devel] [PATCH 03/19] buffer: add buffer_move_empty, Gerd Hoffmann, 2015/10/30
- [Qemu-devel] [PATCH 10/19] vnc: zap dead code, Gerd Hoffmann, 2015/10/30
- [Qemu-devel] [PATCH 19/19] buffer: allow a buffer to shrink gracefully, Gerd Hoffmann, 2015/10/30
- [Qemu-devel] [PATCH 13/19] vnc: use vnc_{width, height} in vnc_set_area_dirty,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 18/19] buffer: factor out buffer_adj_size, Gerd Hoffmann, 2015/10/30
- [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