From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNH0l-0002xq-8A for qemu-devel@nongnu.org; Mon, 16 Feb 2015 03:26:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNH0i-0007zW-3n for qemu-devel@nongnu.org; Mon, 16 Feb 2015 03:26:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNH0h-0007zM-TM for qemu-devel@nongnu.org; Mon, 16 Feb 2015 03:26:32 -0500 From: Gerd Hoffmann Date: Mon, 16 Feb 2015 09:26:04 +0100 Message-Id: <1424075165-25016-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1424075165-25016-1-git-send-email-kraxel@redhat.com> References: <1424075165-25016-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 6/7] 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 , Gerd Hoffmann , Anthony Liguori From: Peter Lieven 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 Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/vnc.c b/ui/vnc.c index faa218f..14289fd 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1111,6 +1111,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.8.3.1