Patchwork [PATCHv3,5/6] ui/vnc: optimize setting in vnc_dpy_update()

login
register
mail settings
Submitter Peter Lieven
Date Jan. 5, 2014, 6:02 p.m.
Message ID <1388944951-14767-6-git-send-email-pl@kamp.de>
Download mbox | patch
Permalink /patch/307006/
State New
Headers show

Comments

Peter Lieven - Jan. 5, 2014, 6:02 p.m.
Signed-off-by: Peter Lieven <pl@kamp.de>
---
 ui/vnc.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Patch

diff --git a/ui/vnc.c b/ui/vnc.c
index 980df34..805c47a 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -430,7 +430,6 @@  static int vnc_refresh_server_surface(VncDisplay *vd);
 static void vnc_dpy_update(DisplayChangeListener *dcl,
                            int x, int y, int w, int h)
 {
-    int i;
     VncDisplay *vd = container_of(dcl, VncDisplay, dcl);
     struct VncSurface *s = &vd->guest;
     int width = surface_width(vd->ds);
@@ -451,9 +450,8 @@  static void vnc_dpy_update(DisplayChangeListener *dcl,
     h = MIN(h, height);
 
     for (; y < h; y++) {
-        for (i = 0; i < w; i += VNC_DIRTY_PIXELS_PER_BIT) {
-            set_bit((x + i) / VNC_DIRTY_PIXELS_PER_BIT, s->dirty[y]);
-        }
+        bitmap_set(s->dirty[y], x / VNC_DIRTY_PIXELS_PER_BIT,
+                   w / VNC_DIRTY_PIXELS_PER_BIT);
     }
 }