diff options
Diffstat (limited to 'src/mesa/main/readpix.c')
-rw-r--r-- | src/mesa/main/readpix.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index 12779446c6d..03a484c438c 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -613,15 +613,8 @@ read_rgba_pixels( struct gl_context *ctx, done_swap: /* Handle byte swapping if required */ if (packing->SwapBytes) { - GLint swapSize = _mesa_sizeof_packed_type(type); - if (swapSize == 2 || swapSize == 4) { - int swapsPerPixel = _mesa_bytes_per_pixel(format, type) / swapSize; - assert(_mesa_bytes_per_pixel(format, type) % swapSize == 0); - if (swapSize == 2) - _mesa_swap2((GLushort *) dst, width * height * swapsPerPixel); - else if (swapSize == 4) - _mesa_swap4((GLuint *) dst, width * height * swapsPerPixel); - } + _mesa_swap_bytes_2d_image(format, type, packing, + width, height, dst, dst); } done_unmap: |