aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2010-07-07 20:58:04 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-07-26 17:36:14 -0500
commit4043a0137b183e0df1e1404d4852aa7395788f55 (patch)
treefa1e5f719760b107b1fa5be3f5cfe364ed7c3f7a /ui
parentd01f9595400788ca8a117522f5dfbc43c59b4cc7 (diff)
downloadqemu-4043a0137b183e0df1e1404d4852aa7395788f55.zip
qemu-4043a0137b183e0df1e1404d4852aa7395788f55.tar.gz
qemu-4043a0137b183e0df1e1404d4852aa7395788f55.tar.bz2
vnc: tight: fix rgb_prepare_row
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>
Diffstat (limited to 'ui')
-rw-r--r--ui/vnc-enc-tight.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
index 3f19df2..eaa88ce 100644
--- a/ui/vnc-enc-tight.c
+++ b/ui/vnc-enc-tight.c
@@ -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 */