[Glamor] [PATCH] glamor: Correctly specificy the stride parameter for glamor_put_image

Anthony Waters awaters1 at gmail.com
Fri Feb 14 23:42:33 CET 2014


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 at gmail.com>
---
 src/glamor_putimage.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/glamor_putimage.c b/src/glamor_putimage.c
index 8b36f45..acc8a05 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;
-- 
1.8.5.5



More information about the Glamor mailing list