]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
vnc: tight: fix rgb_prepare_row
authorCorentin Chary <corentincj@iksaif.net>
Wed, 7 Jul 2010 18:58:04 +0000 (20:58 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 26 Jul 2010 22:36:14 +0000 (17:36 -0500)
rgb_prepare_row bpp depends on the server display surface, not
the client.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ui/vnc-enc-tight.c

index 3f19df2ba79700ecc60187eb22ee3592e6d66434..eaa88cef9a45eb91e1fd7e69e82dc351d8a5d6e4 100644 (file)
@@ -1180,12 +1180,17 @@ DEFINE_RGB_GET_ROW_FUNCTION(32)
 static void rgb_prepare_row(VncState *vs, uint8_t *dst, int x, int y,
                             int count)
 {
-    if (vs->tight.pixel24)
-        rgb_prepare_row24(vs, dst, x, y, count);
-    else if (ds_get_bytes_per_pixel(vs->ds) == 4)
-        rgb_prepare_row32(vs, dst, x, y, count);
-    else
+    if (ds_get_bytes_per_pixel(vs->ds) == 4) {
+        if (vs->ds->surface->pf.rmax == 0xFF &&
+            vs->ds->surface->pf.gmax == 0xFF &&
+            vs->ds->surface->pf.bmax == 0xFF) {
+            rgb_prepare_row24(vs, dst, x, y, count);
+        } else {
+            rgb_prepare_row32(vs, dst, x, y, count);
+        }
+    } else {
         rgb_prepare_row16(vs, dst, x, y, count);
+    }
 }
 #endif /* CONFIG_VNC_JPEG or CONFIG_VNC_PNG */