OSDN Git Service

mesa: fix SwapBytes handling in numerous places
authorDave Airlie <airlied@redhat.com>
Tue, 25 Aug 2015 04:36:01 +0000 (14:36 +1000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Sun, 6 Sep 2015 17:33:47 +0000 (18:33 +0100)
commitd9534e4785b26a0c65153dad934ab8a03723d89c
tree807ce8e707b3e8d7afd0527fec5ca1ce73f74a54
parent63b4e6bfc931d0da1a31389f7f44e297c988971d
mesa: fix SwapBytes handling in numerous places

In a number of places the SwapBytes handling didn't handle cases with
GL_(UN)PACK_ALIGNMENT set and 7 byte width cases aligned to 8 bytes.

This adds a common routine to swap bytes a 2D image and uses this
code in:

texture storage
texture get
readpixels
swrast drawpixels.

[airlied: updated with Brian's nitpicks].

Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 0ad3a475ef81dad3baf607d749b91dfa1700ca23)
src/mesa/main/image.c
src/mesa/main/image.h
src/mesa/main/readpix.c
src/mesa/main/texgetimage.c
src/mesa/main/texstore.c
src/mesa/swrast/s_drawpix.c