summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-09-23 15:46:54 +0200
committerGerd Hoffmann <kraxel@redhat.com>2010-09-23 15:46:54 +0200
commitba58bd0a1220f05ac9b7a5e03b823b133f8384fd (patch)
tree19dbe80dedcc6cd4159095915cac0bd97fa0ebf6
parentf4a31d41cd3e333a69dc6a459143ff49b8d544cd (diff)
handle SPICE_STREAM_FLAGS_TOP_DOWN
-rw-r--r--gtk/channel-display.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index 5ccf5dd..7e80b71 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -345,9 +345,18 @@ static void display_handle_stream_data(SpiceChannel *channel, spice_msg_in *in)
if (st->out_frame) {
SpiceMsgDisplayStreamCreate *info = spice_msg_in_parsed(st->msg_create);
+ uint8_t *data;
+ int stride;
+
+ data = st->out_frame;
+ stride = info->src_width * sizeof(uint32_t);
+ if (!(info->flags & SPICE_STREAM_FLAGS_TOP_DOWN)) {
+ data += stride * (info->src_height - 1);
+ stride = -stride;
+ }
st->surface->canvas->ops->put_image
- (st->surface->canvas, &info->dest, st->out_frame,
- info->src_width, info->src_height, info->src_width * 4,
+ (st->surface->canvas, &info->dest, data,
+ info->src_width, info->src_height, stride,
NULL /* FIXME: st->clip */ );
if (st->surface->primary)
emit_invalidate(channel, &info->dest);