mesa: fix SwapBytes handling in numerous places
authorDave Airlie <airlied@redhat.com>
Tue, 25 Aug 2015 04:36:01 +0000 (14:36 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 1 Sep 2015 23:16:43 +0000 (09:16 +1000)
commit0ad3a475ef81dad3baf607d749b91dfa1700ca23
treea9232bc66a31900353ab3d0a1135333c8b6f9299
parent60aea3011525de8bf6506e08c913cbe24cc17767
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>
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