From: Peter Lieven Date: Mon, 2 Feb 2015 15:25:34 +0000 (+0100) Subject: ui/vnc: optimize full scanline updates X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0e7d6f608339029404efd025ae9b8965ffe60087;p=qemu.git ui/vnc: optimize full scanline updates 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 --- diff --git a/ui/vnc.c b/ui/vnc.c index faa218f84b..14289fd951 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);