Commit 014ec638 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Remove some unused palette code.

parent 3c57f113
...@@ -134,20 +134,12 @@ static void palette_set_mapping( HPALETTE hpal, int *mapping ) ...@@ -134,20 +134,12 @@ static void palette_set_mapping( HPALETTE hpal, int *mapping )
*/ */
int X11DRV_PALETTE_Init(void) int X11DRV_PALETTE_Init(void)
{ {
int mask, white, black;
int monoPlane;
int *mapping; int *mapping;
PALETTEENTRY sys_pal_template[NB_RESERVED_COLORS]; PALETTEENTRY sys_pal_template[NB_RESERVED_COLORS];
TRACE("initializing palette manager...\n"); TRACE("initializing palette manager...\n");
palette_context = XUniqueContext(); palette_context = XUniqueContext();
white = WhitePixel( gdi_display, DefaultScreen(gdi_display) );
black = BlackPixel( gdi_display, DefaultScreen(gdi_display) );
monoPlane = 1;
for( mask = 1; !((white & mask)^(black & mask)); mask <<= 1 )
monoPlane++;
X11DRV_PALETTE_PaletteFlags = (white & mask) ? X11DRV_PALETTE_WHITESET : 0;
palette_size = default_visual.colormap_size; palette_size = default_visual.colormap_size;
switch(default_visual.class) switch(default_visual.class)
...@@ -165,11 +157,7 @@ int X11DRV_PALETTE_Init(void) ...@@ -165,11 +157,7 @@ int X11DRV_PALETTE_Init(void)
default_visual.visual, AllocAll ); default_visual.visual, AllocAll );
if (default_colormap) if (default_colormap)
{ {
X11DRV_PALETTE_PaletteFlags |= (X11DRV_PALETTE_PRIVATE | X11DRV_PALETTE_WHITESET); X11DRV_PALETTE_PaletteFlags |= X11DRV_PALETTE_PRIVATE;
monoPlane = 1;
for( white = palette_size - 1; !(white & 1); white >>= 1 )
monoPlane++;
if( root_window != DefaultRootWindow(gdi_display) ) if( root_window != DefaultRootWindow(gdi_display) )
{ {
...@@ -187,36 +175,20 @@ int X11DRV_PALETTE_Init(void) ...@@ -187,36 +175,20 @@ int X11DRV_PALETTE_Init(void)
case TrueColor: case TrueColor:
X11DRV_PALETTE_PaletteFlags |= X11DRV_PALETTE_VIRTUAL; X11DRV_PALETTE_PaletteFlags |= X11DRV_PALETTE_VIRTUAL;
case StaticColor: { case StaticColor:
int *depths,nrofdepths; X11DRV_PALETTE_PaletteFlags |= X11DRV_PALETTE_FIXED;
/* FIXME: hack to detect XFree32 XF_VGA16 ... We just have X11DRV_PALETTE_ComputeColorShifts(&X11DRV_PALETTE_default_shifts, default_visual.red_mask, default_visual.green_mask, default_visual.blue_mask);
* depths 1 and 4
*/
depths = XListDepths(gdi_display,DefaultScreen(gdi_display),&nrofdepths);
if ((nrofdepths==2) && ((depths[0]==4) || depths[1]==4)) {
monoPlane = 1;
for( white = palette_size - 1; !(white & 1); white >>= 1 )
monoPlane++;
X11DRV_PALETTE_PaletteFlags = (white & mask) ? X11DRV_PALETTE_WHITESET : 0;
}
else
{
X11DRV_PALETTE_PaletteFlags |= X11DRV_PALETTE_FIXED;
X11DRV_PALETTE_ComputeColorShifts(&X11DRV_PALETTE_default_shifts, default_visual.red_mask, default_visual.green_mask, default_visual.blue_mask);
}
XFree(depths);
break; break;
}
} }
GetPaletteEntries( GetStockObject(DEFAULT_PALETTE), 0, NB_RESERVED_COLORS, sys_pal_template );
if( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL ) if( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL )
{ {
palette_size = 0; palette_size = 0;
} }
else else
{ {
GetPaletteEntries( GetStockObject(DEFAULT_PALETTE), 0, NB_RESERVED_COLORS, sys_pal_template );
if ((mapping = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(int) * NB_RESERVED_COLORS ))) if ((mapping = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(int) * NB_RESERVED_COLORS )))
palette_set_mapping( GetStockObject(DEFAULT_PALETTE), mapping ); palette_set_mapping( GetStockObject(DEFAULT_PALETTE), mapping );
...@@ -743,12 +715,6 @@ COLORREF X11DRV_PALETTE_ToLogical(X11DRV_PDEVICE *physDev, int pixel) ...@@ -743,12 +715,6 @@ COLORREF X11DRV_PALETTE_ToLogical(X11DRV_PDEVICE *physDev, int pixel)
{ {
XColor color; XColor color;
#if 0
/* truecolor visual */
if (screen_depth >= 24) return pixel;
#endif
/* check for hicolor visuals first */ /* check for hicolor visuals first */
if ( (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED) && !X11DRV_PALETTE_Graymax ) if ( (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED) && !X11DRV_PALETTE_Graymax )
...@@ -969,7 +935,7 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color ) ...@@ -969,7 +935,7 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
/*********************************************************************** /***********************************************************************
* X11DRV_PALETTE_LookupPixel * X11DRV_PALETTE_LookupPixel
*/ */
int X11DRV_PALETTE_LookupPixel(ColorShifts *shifts, COLORREF color ) static int X11DRV_PALETTE_LookupPixel(ColorShifts *shifts, COLORREF color )
{ {
unsigned char spec_type = color >> 24; unsigned char spec_type = color >> 24;
......
...@@ -243,7 +243,6 @@ extern Display *gdi_display DECLSPEC_HIDDEN; /* display to use for all GDI func ...@@ -243,7 +243,6 @@ extern Display *gdi_display DECLSPEC_HIDDEN; /* display to use for all GDI func
#define X11DRV_PALETTE_VIRTUAL 0x0002 /* no mapping needed - pixel == pixel color */ #define X11DRV_PALETTE_VIRTUAL 0x0002 /* no mapping needed - pixel == pixel color */
#define X11DRV_PALETTE_PRIVATE 0x1000 /* private colormap, identity mapping */ #define X11DRV_PALETTE_PRIVATE 0x1000 /* private colormap, identity mapping */
#define X11DRV_PALETTE_WHITESET 0x2000
extern UINT16 X11DRV_PALETTE_PaletteFlags DECLSPEC_HIDDEN; extern UINT16 X11DRV_PALETTE_PaletteFlags DECLSPEC_HIDDEN;
...@@ -259,7 +258,6 @@ extern BOOL X11DRV_IsSolidColor(COLORREF color) DECLSPEC_HIDDEN; ...@@ -259,7 +258,6 @@ extern BOOL X11DRV_IsSolidColor(COLORREF color) DECLSPEC_HIDDEN;
extern COLORREF X11DRV_PALETTE_ToLogical(X11DRV_PDEVICE *physDev, int pixel) DECLSPEC_HIDDEN; extern COLORREF X11DRV_PALETTE_ToLogical(X11DRV_PDEVICE *physDev, int pixel) DECLSPEC_HIDDEN;
extern int X11DRV_PALETTE_ToPhysical(X11DRV_PDEVICE *physDev, COLORREF color) DECLSPEC_HIDDEN; extern int X11DRV_PALETTE_ToPhysical(X11DRV_PDEVICE *physDev, COLORREF color) DECLSPEC_HIDDEN;
extern COLORREF X11DRV_PALETTE_GetColor( X11DRV_PDEVICE *physDev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_PALETTE_GetColor( X11DRV_PDEVICE *physDev, COLORREF color ) DECLSPEC_HIDDEN;
extern int X11DRV_PALETTE_LookupPixel(ColorShifts *shifts, COLORREF color) DECLSPEC_HIDDEN;
extern void X11DRV_PALETTE_ComputeColorShifts(ColorShifts *shifts, unsigned long redMask, unsigned long greenMask, unsigned long blueMask) DECLSPEC_HIDDEN; extern void X11DRV_PALETTE_ComputeColorShifts(ColorShifts *shifts, unsigned long redMask, unsigned long greenMask, unsigned long blueMask) DECLSPEC_HIDDEN;
/* GDI escapes */ /* GDI escapes */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment