Alexandre Julliard : winex11: Remove some unused palette code.

Alexandre Julliard julliard at winehq.org
Wed Sep 26 14:06:50 CDT 2012


Module: wine
Branch: master
Commit: 014ec638d6ba50c68dd41edd3a4a33bf03cbe8a1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=014ec638d6ba50c68dd41edd3a4a33bf03cbe8a1

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Sep 26 13:08:40 2012 +0200

winex11: Remove some unused palette code.

---

 dlls/winex11.drv/palette.c |   48 ++++++-------------------------------------
 dlls/winex11.drv/x11drv.h  |    2 -
 2 files changed, 7 insertions(+), 43 deletions(-)

diff --git a/dlls/winex11.drv/palette.c b/dlls/winex11.drv/palette.c
index f5f8628..91476d4 100644
--- a/dlls/winex11.drv/palette.c
+++ b/dlls/winex11.drv/palette.c
@@ -134,20 +134,12 @@ static void palette_set_mapping( HPALETTE hpal, int *mapping )
  */
 int X11DRV_PALETTE_Init(void)
 {
-    int	mask, white, black;
-    int monoPlane;
     int *mapping;
     PALETTEENTRY sys_pal_template[NB_RESERVED_COLORS];
 
     TRACE("initializing palette manager...\n");
 
     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;
 
     switch(default_visual.class)
@@ -165,11 +157,7 @@ int X11DRV_PALETTE_Init(void)
                                                 default_visual.visual, AllocAll );
 	    if (default_colormap)
 	    {
-	        X11DRV_PALETTE_PaletteFlags |= (X11DRV_PALETTE_PRIVATE | X11DRV_PALETTE_WHITESET);
-
-		monoPlane = 1;
-		for( white = palette_size - 1; !(white & 1); white >>= 1 )
-		     monoPlane++;
+	        X11DRV_PALETTE_PaletteFlags |= X11DRV_PALETTE_PRIVATE;
 
 	        if( root_window != DefaultRootWindow(gdi_display) )
 	        {
@@ -187,36 +175,20 @@ int X11DRV_PALETTE_Init(void)
 
     case TrueColor:
 	X11DRV_PALETTE_PaletteFlags |= X11DRV_PALETTE_VIRTUAL;
-    case StaticColor: {
-    	int *depths,nrofdepths;
-	/* FIXME: hack to detect XFree32 XF_VGA16 ... We just have
-	 * 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);
+    case StaticColor:
+        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);
         break;
-      }
     }
 
-    GetPaletteEntries( GetStockObject(DEFAULT_PALETTE), 0, NB_RESERVED_COLORS, sys_pal_template );
-
     if( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL )
     {
         palette_size = 0;
     }
     else
     {
+        GetPaletteEntries( GetStockObject(DEFAULT_PALETTE), 0, NB_RESERVED_COLORS, sys_pal_template );
+
         if ((mapping = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(int) * NB_RESERVED_COLORS )))
             palette_set_mapping( GetStockObject(DEFAULT_PALETTE), mapping );
 
@@ -743,12 +715,6 @@ COLORREF X11DRV_PALETTE_ToLogical(X11DRV_PDEVICE *physDev, int pixel)
 {
     XColor color;
 
-#if 0
-    /* truecolor visual */
-
-    if (screen_depth >= 24) return pixel;
-#endif
-
     /* check for hicolor visuals first */
 
     if ( (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED) && !X11DRV_PALETTE_Graymax )
@@ -969,7 +935,7 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
 /***********************************************************************
  *           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;
 
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 5f5aab0..7a7cfd3 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -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_PRIVATE  0x1000 /* private colormap, identity mapping */
-#define X11DRV_PALETTE_WHITESET 0x2000
 
 extern UINT16 X11DRV_PALETTE_PaletteFlags 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 int X11DRV_PALETTE_ToPhysical(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;
 
 /* GDI escapes */




More information about the wine-cvs mailing list