From 94fa372b8f49533219d00127ee9b7aa21756f6c1 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Wed, 14 Aug 2002 21:07:40 +0000 Subject: [PATCH] Avoid dodgy asm optimization if the server's byte order is not LSBFirst. --- graphics/x11drv/dib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/graphics/x11drv/dib.c b/graphics/x11drv/dib.c index 3fc14d7935f..bd437675bbb 100644 --- a/graphics/x11drv/dib.c +++ b/graphics/x11drv/dib.c @@ -2481,7 +2481,8 @@ static void X11DRV_DIB_SetImageBits_8( int lines, const BYTE *srcbits, case 16: #if defined(__i386__) && defined(__GNUC__) /* Some X servers might have 32 bit/ 16bit deep pixel */ - if (lines && dstwidth && (bmpImage->bits_per_pixel == 16)) + if (lines && dstwidth && (bmpImage->bits_per_pixel == 16) && + (ImageByteOrder(gdi_display)==LSBFirst) ) { dstbits=bmpImage->data+left*2+(lines-1)*bmpImage->bytes_per_line; /* FIXME: Does this really handle all these cases correctly? */ @@ -2515,7 +2516,8 @@ static void X11DRV_DIB_SetImageBits_8( int lines, const BYTE *srcbits, case 24: case 32: #if defined(__i386__) && defined(__GNUC__) - if (lines && dstwidth && (bmpImage->bits_per_pixel == 32)) + if (lines && dstwidth && (bmpImage->bits_per_pixel == 32) && + (ImageByteOrder(gdi_display)==LSBFirst) ) { dstbits=bmpImage->data+left*4+(lines-1)*bmpImage->bytes_per_line; /* FIXME: Does this really handle both cases correctly? */