mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 00:25:27 +00:00
fixing image colors on beos. patch from Wade Majors <guru@startrek.com>. bug 75339. r=pavlov sr=cls@seawood.org
This commit is contained in:
parent
8be7b6f9d9
commit
7f6c689f4d
@ -333,7 +333,7 @@ int HaveDecodedRow(
|
||||
if (decoder->mGIFStruct->is_transparent)
|
||||
format = gfxIFormats::RGB_A1;
|
||||
|
||||
#ifdef XP_PC
|
||||
#if defined(XP_PC) || defined(XP_BEOS)
|
||||
// XXX this works...
|
||||
format += 1; // RGB to BGR
|
||||
#endif
|
||||
@ -421,7 +421,7 @@ int HaveDecodedRow(
|
||||
PRUint32 iwidth = (PRUint32)width;
|
||||
for (PRUint32 x=0; x<iwidth; x++) {
|
||||
if (*rowBufIndex != decoder->mGIFStruct->tpixel) {
|
||||
#ifdef XP_PC
|
||||
#if defined(XP_PC) || defined(XP_BEOS)
|
||||
*rgbRowIndex++ = cmap[PRUint8(*rowBufIndex)].blue;
|
||||
*rgbRowIndex++ = cmap[PRUint8(*rowBufIndex)].green;
|
||||
*rgbRowIndex++ = cmap[PRUint8(*rowBufIndex)].red;
|
||||
|
@ -310,7 +310,7 @@ NS_IMETHODIMP nsJPEGDecoder::WriteFrom(nsIInputStream *inStr, PRUint32 count, PR
|
||||
}
|
||||
|
||||
gfx_format format = gfxIFormats::RGB;
|
||||
#ifdef XP_PC
|
||||
#if defined(XP_PC) || defined(XP_BEOS)
|
||||
format = gfxIFormats::BGR;
|
||||
#endif
|
||||
|
||||
@ -524,7 +524,7 @@ nsJPEGDecoder::OutputScanlines(int num_scanlines)
|
||||
samples = mSamples3[0];
|
||||
} else {
|
||||
/* 24-bit color image */
|
||||
#ifdef XP_PC
|
||||
#if defined(XP_PC) || defined(XP_BEOS)
|
||||
memset(mRGBPadRow, 0, mInfo.output_width * 4);
|
||||
PRUint8 *ptrOutputBuf = mRGBPadRow;
|
||||
|
||||
@ -537,8 +537,7 @@ nsJPEGDecoder::OutputScanlines(int num_scanlines)
|
||||
}
|
||||
|
||||
samples = mRGBPadRow;
|
||||
#else
|
||||
#ifdef XP_MAC
|
||||
#elif defined(XP_MAC)
|
||||
memset(mRGBPadRow, 0, mInfo.output_width * 4);
|
||||
PRUint8 *ptrOutputBuf = mRGBPadRow;
|
||||
|
||||
@ -554,7 +553,6 @@ nsJPEGDecoder::OutputScanlines(int num_scanlines)
|
||||
samples = mRGBPadRow;
|
||||
#else
|
||||
samples = mSamples[0];
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -234,7 +234,7 @@ info_callback(png_structp png_ptr, png_infop info_ptr)
|
||||
png_set_gray_to_rgb(png_ptr);
|
||||
|
||||
|
||||
#ifdef XP_PC
|
||||
#if defined(XP_PC) || defined(XP_BEOS)
|
||||
// windows likes BGR
|
||||
png_set_bgr(png_ptr);
|
||||
#endif
|
||||
@ -333,7 +333,7 @@ info_callback(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef XP_PC
|
||||
#if defined(XP_PC) || defined(XP_BEOS)
|
||||
// XXX this works...
|
||||
format += 1; // RGB to BGR
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user