summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Celaya <javier.celaya@flexvm.es>2015-01-28 11:49:45 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2015-02-03 10:43:31 +0100
commit83c0d642edd0126df14a7fc4881412be2ad55e15 (patch)
tree91b2ebc150adf24f3234843b6040a37e023b5e75
parent6049db492f527a8d48ca951613fa5fe467646aaa (diff)
LZ4: Adjust reading the top_down flag
Adjust the way the top_down flag is read to the corresponding change in the wire protocol.
-rw-r--r--common/canvas_base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/canvas_base.c b/common/canvas_base.c
index f2898ca..d5bd9d0 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -525,7 +525,7 @@ static pixman_image_t *canvas_get_lz4(CanvasBase *canvas, SpiceImage *image)
int stride;
int stride_abs;
uint8_t *dest, *data, *data_end;
- int width, height, direction;
+ int width, height, top_down;
LZ4_streamDecode_t *stream;
spice_chunks_linearize(image->u.lz4.data);
@@ -533,14 +533,14 @@ static pixman_image_t *canvas_get_lz4(CanvasBase *canvas, SpiceImage *image)
data_end = data + image->u.lz4.data->chunk[0].len;
width = image->descriptor.width;
height = image->descriptor.height;
- direction = *(data++);
+ top_down = *(data++);
surface = surface_create(
#ifdef WIN32
canvas->dc,
#endif
PIXMAN_a8r8g8b8,
- width, height, direction == 0);
+ width, height, top_down);
if (surface == NULL) {
spice_warning("create surface failed");
return NULL;
@@ -551,7 +551,7 @@ static pixman_image_t *canvas_get_lz4(CanvasBase *canvas, SpiceImage *image)
stride = pixman_image_get_stride(surface);
stride_abs = abs(stride);
available = height * stride_abs;
- if (direction == 1) {
+ if (!top_down) {
dest -= (stride_abs * (height - 1));
}