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:
pavlov%netscape.com 2001-04-23 08:27:06 +00:00
Родитель 8be7b6f9d9
Коммит 7f6c689f4d
3 изменённых файлов: 7 добавлений и 9 удалений

Просмотреть файл

@ -333,7 +333,7 @@ int HaveDecodedRow(
if (decoder->mGIFStruct->is_transparent) if (decoder->mGIFStruct->is_transparent)
format = gfxIFormats::RGB_A1; format = gfxIFormats::RGB_A1;
#ifdef XP_PC #if defined(XP_PC) || defined(XP_BEOS)
// XXX this works... // XXX this works...
format += 1; // RGB to BGR format += 1; // RGB to BGR
#endif #endif
@ -421,7 +421,7 @@ int HaveDecodedRow(
PRUint32 iwidth = (PRUint32)width; PRUint32 iwidth = (PRUint32)width;
for (PRUint32 x=0; x<iwidth; x++) { for (PRUint32 x=0; x<iwidth; x++) {
if (*rowBufIndex != decoder->mGIFStruct->tpixel) { if (*rowBufIndex != decoder->mGIFStruct->tpixel) {
#ifdef XP_PC #if defined(XP_PC) || defined(XP_BEOS)
*rgbRowIndex++ = cmap[PRUint8(*rowBufIndex)].blue; *rgbRowIndex++ = cmap[PRUint8(*rowBufIndex)].blue;
*rgbRowIndex++ = cmap[PRUint8(*rowBufIndex)].green; *rgbRowIndex++ = cmap[PRUint8(*rowBufIndex)].green;
*rgbRowIndex++ = cmap[PRUint8(*rowBufIndex)].red; *rgbRowIndex++ = cmap[PRUint8(*rowBufIndex)].red;

Просмотреть файл

@ -310,7 +310,7 @@ NS_IMETHODIMP nsJPEGDecoder::WriteFrom(nsIInputStream *inStr, PRUint32 count, PR
} }
gfx_format format = gfxIFormats::RGB; gfx_format format = gfxIFormats::RGB;
#ifdef XP_PC #if defined(XP_PC) || defined(XP_BEOS)
format = gfxIFormats::BGR; format = gfxIFormats::BGR;
#endif #endif
@ -524,7 +524,7 @@ nsJPEGDecoder::OutputScanlines(int num_scanlines)
samples = mSamples3[0]; samples = mSamples3[0];
} else { } else {
/* 24-bit color image */ /* 24-bit color image */
#ifdef XP_PC #if defined(XP_PC) || defined(XP_BEOS)
memset(mRGBPadRow, 0, mInfo.output_width * 4); memset(mRGBPadRow, 0, mInfo.output_width * 4);
PRUint8 *ptrOutputBuf = mRGBPadRow; PRUint8 *ptrOutputBuf = mRGBPadRow;
@ -537,8 +537,7 @@ nsJPEGDecoder::OutputScanlines(int num_scanlines)
} }
samples = mRGBPadRow; samples = mRGBPadRow;
#else #elif defined(XP_MAC)
#ifdef XP_MAC
memset(mRGBPadRow, 0, mInfo.output_width * 4); memset(mRGBPadRow, 0, mInfo.output_width * 4);
PRUint8 *ptrOutputBuf = mRGBPadRow; PRUint8 *ptrOutputBuf = mRGBPadRow;
@ -554,7 +553,6 @@ nsJPEGDecoder::OutputScanlines(int num_scanlines)
samples = mRGBPadRow; samples = mRGBPadRow;
#else #else
samples = mSamples[0]; samples = mSamples[0];
#endif
#endif #endif
} }

Просмотреть файл

@ -234,7 +234,7 @@ info_callback(png_structp png_ptr, png_infop info_ptr)
png_set_gray_to_rgb(png_ptr); png_set_gray_to_rgb(png_ptr);
#ifdef XP_PC #if defined(XP_PC) || defined(XP_BEOS)
// windows likes BGR // windows likes BGR
png_set_bgr(png_ptr); png_set_bgr(png_ptr);
#endif #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... // XXX this works...
format += 1; // RGB to BGR format += 1; // RGB to BGR
#endif #endif