summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/glx
diff options
context:
space:
mode:
authorRichard Sandiford <[email protected]>2013-06-17 12:13:25 -0400
committerAdam Jackson <[email protected]>2013-06-17 12:15:13 -0400
commitc132c2978b02da7140462a633605a0127dfcceb4 (patch)
treead6222b776d9d9af5e249982d5f94b29d7756299 /src/gallium/state_trackers/glx
parent876fefe2ff8901ae4b908cff89ac5dd4324f4fe5 (diff)
st/xlib: Fix XImage stride calculation
Fixes window skew seen while running gnome on a 16-bit screen over vnc. NOTE: This is a candidate for stable release branches. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Richard Sandiford <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/glx')
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_api.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c
index 7ed401c514b..daf5ad43d74 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_api.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_api.c
@@ -1381,7 +1381,7 @@ XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer,
enum pipe_format internal_format = res->format;
struct pipe_transfer *tex_xfer;
char *map;
- int line, ximage_stride;
+ int line, byte_width;
XImage *img;
internal_format = choose_pixel_format(drawable->xm_visual);
@@ -1408,12 +1408,12 @@ XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer,
}
/* The pipe transfer has a pitch rounded up to the nearest 64 pixels. */
- ximage_stride = w * ((img->bits_per_pixel + 7) / 8);
+ byte_width = w * ((img->bits_per_pixel + 7) / 8);
for (line = 0; line < h; line++)
memcpy(&map[line * tex_xfer->stride],
- &img->data[line * ximage_stride],
- ximage_stride);
+ &img->data[line * img->bytes_per_line],
+ byte_width);
pipe_transfer_unmap(pipe, tex_xfer);