mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 05:30:29 +00:00
Fix #defines for Intel Mac (BIG_ENDIAN/LITTLE_ENDIAN); bug 338062, r=vlad, sr=roc
This commit is contained in:
parent
a6a85f54fb
commit
4a48a17812
@ -2670,6 +2670,11 @@ nsCanvasRenderingContext2D::DrawNativeSurfaces(nsIDrawingSurface* aBlackSurface,
|
||||
#define GREEN_BYTE 1
|
||||
#define RED_BYTE 2
|
||||
#define ALPHA_BYTE 3
|
||||
#endif
|
||||
|
||||
// Mac surfaces are big endian.
|
||||
#if defined(IS_BIG_ENDIAN) || defined(XP_MACOSX)
|
||||
#define NATIVE_SURFACE_IS_BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
// Convert the data
|
||||
@ -2684,7 +2689,7 @@ nsCanvasRenderingContext2D::DrawNativeSurfaces(nsIDrawingSurface* aBlackSurface,
|
||||
PRUint8* src = data + i*rowSpan;
|
||||
for (PRInt32 j = 0; j < aSurfaceSize.width; ++j) {
|
||||
/* v is the pixel value */
|
||||
#ifdef IS_BIG_ENDIAN
|
||||
#ifdef NATIVE_SURFACE_IS_BIG_ENDIAN
|
||||
PRUint32 v = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3];
|
||||
v >>= (32 - 8*bytesPerPix);
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user