summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Waters <awaters1@gmail.com>2014-02-14 17:42:33 -0500
committerZhigang Gong <zhigang.gong@gmail.com>2014-02-17 22:33:28 +0800
commit8ad57c288d5ba6478ac9653e43c10545a6bafae1 (patch)
treed0a981d0ede504a690180069f3ded1d588d703d4
parent073c97f494ffe67b15b7a6a95fa894c3e109d862 (diff)
glamor: Correctly specificy the stride parameter for glamor_put_image
The stride parameter is based on bits and is set according to PixmapBytePad Bug: https://bugs.freedesktop.org/show_bug.cgi?id=74733 Signed-off-by: Anthony Waters <awaters1@gmail.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r--src/glamor_putimage.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/glamor_putimage.c b/src/glamor_putimage.c
index 8b36f45..a77be6b 100644
--- a/src/glamor_putimage.c
+++ b/src/glamor_putimage.c
@@ -258,6 +258,7 @@ _glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
PixmapPtr temp_pixmap, sub_pixmap;
glamor_pixmap_private *temp_pixmap_priv;
BoxRec box;
+ int stride;
glamor_get_drawable_deltas(drawable, pixmap, &x_off, &y_off);
clip = fbGetCompositeClip(gc);
@@ -281,6 +282,7 @@ _glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
}
/* create a temporary pixmap and upload the bits to that
* pixmap, then apply clip copy it to the destination pixmap.*/
+ stride = PixmapBytePad(w, depth);
box.x1 = x + drawable->x;
box.y1 = y + drawable->y;
box.x2 = x + w + drawable->x;
@@ -300,12 +302,12 @@ _glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
}
glamor_upload_sub_pixmap_to_texture(temp_pixmap, 0, 0, w, h,
- 0, bits, 0);
+ stride, bits, 0);
glamor_copy_area(&temp_pixmap->drawable, drawable, gc, 0, 0, w, h, x, y);
glamor_destroy_pixmap(temp_pixmap);
} else {
glamor_upload_sub_pixmap_to_texture(pixmap, x + drawable->x + x_off, y + drawable->y + y_off,
- w, h, 0, bits, 0);
+ w, h, stride, bits, 0);
}
ret = TRUE;
goto done;