From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zs7Zh-0005eC-EL for qemu-devel@nongnu.org; Fri, 30 Oct 2015 07:10:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zs7Ze-0002Za-Uc for qemu-devel@nongnu.org; Fri, 30 Oct 2015 07:10:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zs7Ze-0002ZH-Pm for qemu-devel@nongnu.org; Fri, 30 Oct 2015 07:10:22 -0400 From: Gerd Hoffmann Date: Fri, 30 Oct 2015 12:10:08 +0100 Message-Id: <1446203414-4013-14-git-send-email-kraxel@redhat.com> In-Reply-To: <1446203414-4013-1-git-send-email-kraxel@redhat.com> References: <1446203414-4013-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 13/19] vnc: use vnc_{width, height} in vnc_set_area_dirty List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pl@kamp.de, Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- 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