From 0758a3cd45efc8fbf49f008ef3d34626d8842074 Mon Sep 17 00:00:00 2001 From: "dolske@mozilla.com" Date: Sun, 23 Dec 2007 21:41:18 -0800 Subject: [PATCH] Bug 409381 - gif images (with transparency) display corrupted. p=swsnyder@insightbb.com, r,sr=vlad, a=blocking-1.9+ --- gfx/thebes/public/gfxColor.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gfx/thebes/public/gfxColor.h b/gfx/thebes/public/gfxColor.h index 6c01a0357d3e..bac23b6c70ce 100644 --- a/gfx/thebes/public/gfxColor.h +++ b/gfx/thebes/public/gfxColor.h @@ -73,8 +73,13 @@ // Avoid tortured construction of 32-bit ARGB pixel from 3 individual bytes // of memory plus constant 0xFF. RGB bytes are already contiguous! // Equivalent to: GFX_PACKED_PIXEL(0xff,r,g,b) -#define GFX_0XFF_PPIXEL_FROM_BPTR(pbptr) \ - (GFX_BYTESWAP32(*((PRUint32 *)(pbptr))) >> 8) | (0xFF << 24) +#ifndef IS_BIG_ENDIAN +# define GFX_0XFF_PPIXEL_FROM_BPTR(pbptr) \ + (GFX_BYTESWAP32(*((PRUint32 *)(pbptr))) >> 8) | (0xFF << 24) +#else +# define GFX_0XFF_PPIXEL_FROM_BPTR(pbptr) \ + (*((PRUint32 *)(pbptr)) >> 8) | (0xFF << 24) +#endif /* IS_BIG_ENDIAN */ /** * Fast approximate division by 255. It has the property that