зеркало из https://github.com/mozilla/pjs.git
fixing image rendering color problems on photon. patch from briane@qnx.com. r=pavlov sr=blizzard a=asa
This commit is contained in:
Родитель
ba87abb6dd
Коммит
6812332e43
|
@ -402,7 +402,7 @@ int HaveDecodedRow(
|
|||
format = gfxIFormats::RGB_A1;
|
||||
}
|
||||
|
||||
#if defined(XP_PC) || defined(XP_BEOS)
|
||||
#if defined(XP_PC) || defined(XP_BEOS) || defined(MOZ_WIDGET_PHOTON)
|
||||
// XXX this works...
|
||||
format += 1; // RGB to BGR
|
||||
#endif
|
||||
|
@ -511,7 +511,7 @@ int HaveDecodedRow(
|
|||
PRUint32 iwidth = (PRUint32)width;
|
||||
for (PRUint32 x=0; x<iwidth; x++) {
|
||||
if (*rowBufIndex != decoder->mGIFStruct->tpixel) {
|
||||
#if defined(XP_PC) || defined(XP_BEOS)
|
||||
#if defined(XP_PC) || defined(XP_BEOS) || defined(MOZ_WIDGET_PHOTON)
|
||||
*rgbRowIndex++ = cmap[PRUint8(*rowBufIndex)].blue;
|
||||
*rgbRowIndex++ = cmap[PRUint8(*rowBufIndex)].green;
|
||||
*rgbRowIndex++ = cmap[PRUint8(*rowBufIndex)].red;
|
||||
|
|
|
@ -316,7 +316,7 @@ NS_IMETHODIMP nsJPEGDecoder::WriteFrom(nsIInputStream *inStr, PRUint32 count, PR
|
|||
}
|
||||
|
||||
gfx_format format = gfxIFormats::RGB;
|
||||
#if defined(XP_PC) || defined(XP_BEOS)
|
||||
#if defined(XP_PC) || defined(XP_BEOS) || defined(MOZ_WIDGET_PHOTON)
|
||||
format = gfxIFormats::BGR;
|
||||
#endif
|
||||
|
||||
|
@ -346,7 +346,7 @@ NS_IMETHODIMP nsJPEGDecoder::WriteFrom(nsIInputStream *inStr, PRUint32 count, PR
|
|||
JPOOL_IMAGE,
|
||||
row_stride, 1);
|
||||
|
||||
#if defined(XP_PC) || defined(XP_BEOS) || defined(XP_MAC)
|
||||
#if defined(XP_PC) || defined(XP_BEOS) || defined(XP_MAC) || defined(MOZ_WIDGET_PHOTON)
|
||||
// allocate buffer to do byte flipping if needed
|
||||
if (mInfo.output_components == 3) {
|
||||
mRGBPadRow = (PRUint8*) PR_MALLOC(row_stride);
|
||||
|
@ -527,7 +527,7 @@ nsJPEGDecoder::OutputScanlines(int num_scanlines)
|
|||
samples = mSamples3[0];
|
||||
} else {
|
||||
/* 24-bit color image */
|
||||
#if defined(XP_PC) || defined(XP_BEOS)
|
||||
#if defined(XP_PC) || defined(XP_BEOS) || defined(MOZ_WIDGET_PHOTON)
|
||||
memset(mRGBPadRow, 0, mInfo.output_width * 4);
|
||||
PRUint8 *ptrOutputBuf = mRGBPadRow;
|
||||
|
||||
|
|
|
@ -234,7 +234,7 @@ info_callback(png_structp png_ptr, png_infop info_ptr)
|
|||
png_set_gray_to_rgb(png_ptr);
|
||||
|
||||
|
||||
#if defined(XP_PC) || defined(XP_BEOS)
|
||||
#if defined(XP_PC) || defined(XP_BEOS) || defined(MOZ_WIDGET_PHOTON)
|
||||
// windows likes BGR
|
||||
png_set_bgr(png_ptr);
|
||||
#endif
|
||||
|
@ -333,7 +333,7 @@ info_callback(png_structp png_ptr, png_infop info_ptr)
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(XP_PC) || defined(XP_BEOS)
|
||||
#if defined(XP_PC) || defined(XP_BEOS) || defined(MOZ_WIDGET_PHOTON)
|
||||
// XXX this works...
|
||||
format += 1; // RGB to BGR
|
||||
#endif
|
||||
|
|
|
@ -636,7 +636,7 @@ void imgContainer::FillWithColor(gfxIImageFrame *aFrame, gfx_color color)
|
|||
for(PRUint32 y=0; y<iheight; y++) {
|
||||
PRUint8* rgbRowIndex = foo;
|
||||
for (PRUint32 x=0; x<iwidth; x++) {
|
||||
#ifdef XP_WIN
|
||||
#if defined(XP_WIN) || defined(MOZ_WIDGET_PHOTON)
|
||||
*rgbRowIndex++ = (backgroundColor & 0x00FF0000) >> 16;
|
||||
*rgbRowIndex++ = (backgroundColor & 0x0000FF00) >> 8;
|
||||
*rgbRowIndex++ = backgroundColor & 0x000000FF;
|
||||
|
|
Загрузка…
Ссылка в новой задаче