winex11: Fix palette conversion bug.
The LookupPixel code assumed we want to convert pixels to the format corresponding the default color shifts.
This commit is contained in:
parent
f97565191c
commit
3afa657636
|
@ -371,7 +371,7 @@ static int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
|
|||
}
|
||||
else
|
||||
for (i = start; i < end; i++, rgb++)
|
||||
colorMapping[i] = X11DRV_PALETTE_LookupPixel(RGB(rgb->rgbRed,
|
||||
colorMapping[i] = X11DRV_PALETTE_LookupPixel(physDev->color_shifts, RGB(rgb->rgbRed,
|
||||
rgb->rgbGreen,
|
||||
rgb->rgbBlue));
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ static int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
|
|||
}
|
||||
else
|
||||
for (i = start; i < end; i++, rgb++)
|
||||
colorMapping[i] = X11DRV_PALETTE_LookupPixel(RGB(rgb->rgbtRed,
|
||||
colorMapping[i] = X11DRV_PALETTE_LookupPixel(physDev->color_shifts, RGB(rgb->rgbtRed,
|
||||
rgb->rgbtGreen,
|
||||
rgb->rgbtBlue));
|
||||
}
|
||||
|
|
|
@ -1026,7 +1026,7 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
|
|||
/***********************************************************************
|
||||
* X11DRV_PALETTE_LookupPixel
|
||||
*/
|
||||
int X11DRV_PALETTE_LookupPixel(COLORREF color )
|
||||
int X11DRV_PALETTE_LookupPixel(ColorShifts *shifts, COLORREF color )
|
||||
{
|
||||
unsigned char spec_type = color >> 24;
|
||||
|
||||
|
@ -1048,7 +1048,9 @@ int X11DRV_PALETTE_LookupPixel(COLORREF color )
|
|||
}
|
||||
else
|
||||
{
|
||||
ColorShifts *shifts = &X11DRV_PALETTE_default_shifts;
|
||||
/* No shifts are set in case of 1-bit */
|
||||
if(!shifts) shifts = &X11DRV_PALETTE_default_shifts;
|
||||
|
||||
/* scale each individually and construct the TrueColor pixel value */
|
||||
if (shifts->physicalRed.scale < 8)
|
||||
red = red >> (8-shifts->physicalRed.scale);
|
||||
|
@ -1265,7 +1267,7 @@ UINT X11DRV_RealizePalette( X11DRV_PDEVICE *physDev, HPALETTE hpal, BOOL primary
|
|||
}
|
||||
else if ( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL )
|
||||
{
|
||||
index = X11DRV_PALETTE_LookupPixel( RGB( entries[i].peRed, entries[i].peGreen, entries[i].peBlue ));
|
||||
index = X11DRV_PALETTE_LookupPixel( physDev->color_shifts, RGB( entries[i].peRed, entries[i].peGreen, entries[i].peBlue ));
|
||||
}
|
||||
|
||||
/* we have to map to existing entry in the system palette */
|
||||
|
|
|
@ -491,7 +491,7 @@ extern BOOL X11DRV_IsSolidColor(COLORREF color);
|
|||
|
||||
extern COLORREF X11DRV_PALETTE_ToLogical(X11DRV_PDEVICE *physDev, int pixel);
|
||||
extern int X11DRV_PALETTE_ToPhysical(X11DRV_PDEVICE *physDev, COLORREF color);
|
||||
extern int X11DRV_PALETTE_LookupPixel(COLORREF color);
|
||||
extern int X11DRV_PALETTE_LookupPixel(ColorShifts *shifts, COLORREF color);
|
||||
extern void X11DRV_PALETTE_ComputeColorShifts(ColorShifts *shifts, unsigned long redMask, unsigned long greenMask, unsigned long blueMask);
|
||||
|
||||
extern unsigned int depth_to_bpp( unsigned int depth );
|
||||
|
|
Loading…
Reference in New Issue