From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIItE-0004MC-Nu for qemu-devel@nongnu.org; Mon, 02 Feb 2015 10:26:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIIt8-0002RG-VZ for qemu-devel@nongnu.org; Mon, 02 Feb 2015 10:26:16 -0500 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:60708 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIIt8-0002QX-L7 for qemu-devel@nongnu.org; Mon, 02 Feb 2015 10:26:10 -0500 From: Peter Lieven Date: Mon, 2 Feb 2015 16:25:34 +0100 Message-Id: <1422890734-7049-1-git-send-email-pl@kamp.de> Subject: [Qemu-devel] [PATCH] ui/vnc: optimize full scanline updates List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Lieven , kraxel@redhat.com in case we send and update for a complete scanline increment the y offset to avoid running to find_next_bit for that lines twice. Signed-off-by: Peter Lieven --- ui/vnc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/vnc.c b/ui/vnc.c index a742c90..6fa2ee7 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1115,6 +1115,12 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync) n += vnc_job_add_rect(job, x * VNC_DIRTY_PIXELS_PER_BIT, y, (x2 - x) * VNC_DIRTY_PIXELS_PER_BIT, h); } + if (!x && x2 == width / VNC_DIRTY_PIXELS_PER_BIT) { + y += h; + if (y == height) { + break; + } + } } vnc_job_push(job); -- 1.9.1