mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
st/dri/sw: Fix pitch calculation in drisw_update_tex_buffer
swrastGetImage rounds the pitch up to 4 bytes for compatibility reasons
that are explained in drisw_glx.c:bytes_per_line, so drisw_update_tex_buffer
must do the same.
Fixes window skew seen while running firefox over vnc on a 16-bit screen.
NOTE: This is a candidate for the stable branches.
[ajax: fixed typo in comment]
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
(cherry picked from commit 5a0556f061)
This commit is contained in:
parent
5412ae63dc
commit
cda92f5191
1 changed files with 3 additions and 2 deletions
|
|
@ -265,8 +265,9 @@ drisw_update_tex_buffer(struct dri_drawable *drawable,
|
|||
/* Copy the Drawable content to the mapped texture buffer */
|
||||
get_image(dPriv, x, y, w, h, map);
|
||||
|
||||
/* The pipe transfer has a pitch rounded up to the nearest 64 pixels. */
|
||||
ximage_stride = w * cpp;
|
||||
/* The pipe transfer has a pitch rounded up to the nearest 64 pixels.
|
||||
get_image() has a pitch rounded up to 4 bytes. */
|
||||
ximage_stride = ((w * cpp) + 3) & -4;
|
||||
for (line = h-1; line; --line) {
|
||||
memmove(&map[line * transfer->stride],
|
||||
&map[line * ximage_stride],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue