diff mbox

ui/vnc: optimize full scanline updates

Message ID 1422890734-7049-1-git-send-email-pl@kamp.de
State New
Headers show

Commit Message

Peter Lieven Feb. 2, 2015, 3:25 p.m. UTC
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 <pl@kamp.de>
---
 ui/vnc.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Gerd Hoffmann Feb. 10, 2015, 10:20 a.m. UTC | #1
On Mo, 2015-02-02 at 16:25 +0100, Peter Lieven wrote:
> 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.

Added to vnc patch queue.

thanks,
  Gerd
diff mbox

Patch

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);