[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/15] vnc: fix lossy rect refreshing
From: |
Corentin Chary |
Subject: |
[Qemu-devel] [PATCH 10/15] vnc: fix lossy rect refreshing |
Date: |
Wed, 11 Aug 2010 07:49:40 +0200 |
The for loop in send_lossy_rect was totally wrong, and we can't
call vnc_set_bits() because it does not really do what it should.
Use vnc_set_bit() directly instead.
Signed-off-by: Corentin Chary <address@hidden>
---
ui/vnc.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index 27263dc..5038863 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2292,8 +2292,8 @@ void vnc_sent_lossy_rect(VncState *vs, int x, int y, int
w, int h)
x /= VNC_STAT_RECT;
y /= VNC_STAT_RECT;
- for (j = y; j <= y + h; j++) {
- for (i = x; i <= x + w; i++) {
+ for (j = y; j <= h; j++) {
+ for (i = x; i <= w; i++) {
vs->lossy_rect[j][i] = 1;
}
}
@@ -2310,7 +2310,7 @@ static int vnc_refresh_lossy_rect(VncDisplay *vd, int x,
int y)
x = x / VNC_STAT_RECT * VNC_STAT_RECT;
QTAILQ_FOREACH(vs, &vd->clients, next) {
- int j ;
+ int j, i;
/* kernel send buffers are full -> refresh later */
if (vs->output.offset)
@@ -2318,12 +2318,16 @@ static int vnc_refresh_lossy_rect(VncDisplay *vd, int
x, int y)
if (!vs->lossy_rect[sty][stx])
continue ;
+
vs->lossy_rect[sty][stx] = 0;
for (j = 0; j < VNC_STAT_RECT; ++j) {
- vnc_set_bits(vs->dirty[y + j], x / 16, VNC_STAT_RECT / 16);
+ for (i = x / 16; i < VNC_STAT_RECT / 16 + x / 16; ++i) {
+ vnc_set_bit(vs->dirty[y + j], i);
+ }
}
has_dirty++;
}
+
return has_dirty;
}
--
1.7.1
- [Qemu-devel] [PATCH 00/15] vnc: adapative tight, zrle, zywrle, and bitmap module, Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 01/15] vnc: don't set the quality if lossy encoding are disabled, Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 02/15] vnc: add a way to get the update frequency for a given region, Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 03/15] vnc: refresh lossy rect after a given timeout, Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 04/15] vnc: tight: use the update frequency to choose between lossy and lossless, Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 05/15] vnc: palette: use a pool to reduce memory allocations, Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 06/15] vnc: palette: add palette_init calls, Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 07/15] vnc: palette: and fill and color calls., Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 09/15] vnc: fix uint8_t comparisons with negative values, Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 08/15] vnc: Add ZRLE and ZYWRLE encodings., Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 10/15] vnc: fix lossy rect refreshing,
Corentin Chary <=
- [Qemu-devel] [PATCH 11/15] bitmap: add a generic bitmap and bitops library, Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 12/15] vnc: use the new generic bitmap functions, Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 13/15] vnc: don't try to send bigger updates that client height, Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 14/15] vnc: tight: tweak adaptive tight settings, Corentin Chary, 2010/08/11
- [Qemu-devel] [PATCH 15/15] vnc: add a non-adaptive option, Corentin Chary, 2010/08/11