From dc1aeeb2f843e9a09c77f3433267c0e46cb1134e Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sat, 7 Jan 2012 13:27:08 +0100 Subject: [PATCH] gdi32: Get rid of the SetDIBColorTable driver entry point. --- dlls/gdi32/dib.c | 11 ++++++++--- dlls/gdi32/dibdrv/dc.c | 19 ------------------- dlls/gdi32/driver.c | 6 ------ dlls/gdi32/enhmfdrv/init.c | 1 - dlls/gdi32/mfdrv/init.c | 1 - dlls/wineps.drv/init.c | 1 - dlls/winex11.drv/dib.c | 34 ---------------------------------- dlls/winex11.drv/init.c | 1 - dlls/winex11.drv/x11drv.h | 1 - dlls/winex11.drv/xrender.c | 1 - include/wine/gdi_driver.h | 3 +-- 11 files changed, 9 insertions(+), 70 deletions(-) diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index b9ffbbe65e..5aab956904 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -898,8 +898,6 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, CONST RGBQUA if ((bitmap = GDI_GetObjPtr( dc->hBitmap, OBJ_BITMAP ))) { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetDIBColorTable ); - /* Check if currently selected bitmap is a DIB */ if (bitmap->color_table) { @@ -910,7 +908,14 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, CONST RGBQUA } } GDI_ReleaseObj( dc->hBitmap ); - physdev->funcs->pSetDIBColorTable( physdev, startpos, entries, colors ); + + if (result) /* update colors of selected objects */ + { + SetTextColor( hdc, dc->textColor ); + SetBkColor( hdc, dc->backgroundColor ); + SelectObject( hdc, dc->hPen ); + SelectObject( hdc, dc->hBrush ); + } } release_dc_ptr( dc ); return result; diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index 89d916b7ac..6210ad0d1e 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -381,24 +381,6 @@ static void dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) return next->funcs->pSetDeviceClipping( next, rgn ); } -/*********************************************************************** - * dibdrv_SetDIBColorTable - */ -static UINT dibdrv_SetDIBColorTable( PHYSDEV dev, UINT pos, UINT count, const RGBQUAD *colors ) -{ - PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetDIBColorTable ); - dibdrv_physdev *pdev = get_dibdrv_pdev(dev); - TRACE("(%p, %d, %d, %p)\n", dev, pos, count, colors); - - if (pdev->dib.color_table) /* force re-creating the brush bits */ - { - pdev->brush.rop = -1; - pdev->pen_brush.rop = -1; - } - - return next->funcs->pSetDIBColorTable( next, pos, count, colors ); -} - /*********************************************************************** * dibdrv_ChoosePixelFormat */ @@ -684,7 +666,6 @@ const struct gdi_dc_funcs dib_driver = NULL, /* pSetBkMode */ dibdrv_SetDCBrushColor, /* pSetDCBrushColor */ dibdrv_SetDCPenColor, /* pSetDCPenColor */ - dibdrv_SetDIBColorTable, /* pSetDIBColorTable */ NULL, /* pSetDIBitsToDevice */ dibdrv_SetDeviceClipping, /* pSetDeviceClipping */ dibdrv_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */ diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index abb2d6aacc..29b6973b21 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -572,11 +572,6 @@ static COLORREF nulldrv_SetDCPenColor( PHYSDEV dev, COLORREF color ) return color; } -static UINT nulldrv_SetDIBColorTable( PHYSDEV dev, UINT pos, UINT count, const RGBQUAD *colors ) -{ - return 0; -} - static void nulldrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) { } @@ -832,7 +827,6 @@ const struct gdi_dc_funcs null_driver = nulldrv_SetBkMode, /* pSetBkMode */ nulldrv_SetDCBrushColor, /* pSetDCBrushColor */ nulldrv_SetDCPenColor, /* pSetDCPenColor */ - nulldrv_SetDIBColorTable, /* pSetDIBColorTable */ nulldrv_SetDIBitsToDevice, /* pSetDIBitsToDevice */ nulldrv_SetDeviceClipping, /* pSetDeviceClipping */ nulldrv_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */ diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index f4fa4d3d9c..28c2b2f5fc 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -139,7 +139,6 @@ static const struct gdi_dc_funcs EMFDRV_Funcs = EMFDRV_SetBkMode, /* pSetBkMode */ EMFDRV_SetDCBrushColor, /* pSetDCBrushColor*/ EMFDRV_SetDCPenColor, /* pSetDCPenColor*/ - NULL, /* pSetDIBColorTable */ EMFDRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */ NULL, /* pSetDeviceClipping */ NULL, /* pSetDeviceGammaRamp */ diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index b837d845ca..0aa9f3f21f 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -184,7 +184,6 @@ static const struct gdi_dc_funcs MFDRV_Funcs = MFDRV_SetBkMode, /* pSetBkMode */ MFDRV_SetDCBrushColor, /* pSetDCBrushColor*/ MFDRV_SetDCPenColor, /* pSetDCPenColor*/ - NULL, /* pSetDIBColorTable */ MFDRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */ NULL, /* pSetDeviceClipping */ NULL, /* pSetDeviceGammaRamp */ diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index 6ebd7c588d..5f54244421 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -922,7 +922,6 @@ static const struct gdi_dc_funcs psdrv_funcs = NULL, /* pSetBkMode */ PSDRV_SetDCBrushColor, /* pSetDCBrushColor */ PSDRV_SetDCPenColor, /* pSetDCPenColor */ - NULL, /* pSetDIBColorTable */ NULL, /* pSetDIBitsToDevice */ NULL, /* pSetDeviceClipping */ NULL, /* pSetDeviceGammaRamp */ diff --git a/dlls/winex11.drv/dib.c b/dlls/winex11.drv/dib.c index 46e8148813..fe72152196 100644 --- a/dlls/winex11.drv/dib.c +++ b/dlls/winex11.drv/dib.c @@ -4016,40 +4016,6 @@ void X11DRV_DIB_DeleteDIBSection(X_PHYSBITMAP *physBitmap, DIBSECTION *dib) DeleteCriticalSection(&physBitmap->lock); } -/*********************************************************************** - * SetDIBColorTable (X11DRV.@) - */ -UINT X11DRV_SetDIBColorTable( PHYSDEV dev, UINT start, UINT count, const RGBQUAD *colors ) -{ - X11DRV_PDEVICE *physDev = get_x11drv_dev( dev ); - DIBSECTION dib; - UINT ret = 0; - X_PHYSBITMAP *physBitmap = physDev->bitmap; - - if (!physBitmap) return 0; - GetObjectW( physBitmap->hbitmap, sizeof(dib), &dib ); - - if (physBitmap->colorMap && start < physBitmap->nColorMap) { - UINT end = count + start; - if (end > physBitmap->nColorMap) end = physBitmap->nColorMap; - /* - * Changing color table might change the mapping between - * DIB colors and X11 colors and thus alter the visible state - * of the bitmap object. - */ - /* - * FIXME we need to recalculate the pen, brush, text and bkgnd pixels here, - * at least for a 1 bpp dibsection - */ - X11DRV_DIB_Lock( physBitmap, DIB_Status_AppMod ); - X11DRV_DIB_GenColorMap( physDev, physBitmap->colorMap, DIB_RGB_COLORS, - dib.dsBm.bmBitsPixel, colors, start, end ); - X11DRV_DIB_Unlock( physBitmap, TRUE ); - ret = end - start; - } - return ret; -} - /*********************************************************************** * X11DRV_DIB_CreateDIBFromBitmap diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index b094e0a31b..15ab4c2dd8 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -561,7 +561,6 @@ static const struct gdi_dc_funcs x11drv_funcs = NULL, /* pSetBkMode */ X11DRV_SetDCBrushColor, /* pSetDCBrushColor */ X11DRV_SetDCPenColor, /* pSetDCPenColor */ - X11DRV_SetDIBColorTable, /* pSetDIBColorTable */ NULL, /* pSetDIBitsToDevice */ X11DRV_SetDeviceClipping, /* pSetDeviceClipping */ X11DRV_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */ diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 69e761390c..5809778e51 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -230,7 +230,6 @@ extern COLORREF X11DRV_SetDCBrushColor( PHYSDEV dev, COLORREF crColor ) DECLSPEC extern COLORREF X11DRV_SetDCPenColor( PHYSDEV dev, COLORREF crColor ) DECLSPEC_HIDDEN; extern void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) DECLSPEC_HIDDEN; extern BOOL X11DRV_SetDeviceGammaRamp( PHYSDEV dev, LPVOID ramp ) DECLSPEC_HIDDEN; -extern UINT X11DRV_SetDIBColorTable( PHYSDEV dev, UINT start, UINT count, const RGBQUAD *colors ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN; extern BOOL X11DRV_SetPixelFormat(PHYSDEV dev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) DECLSPEC_HIDDEN; extern COLORREF X11DRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 6e4f8d3708..cbe9185c02 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -2778,7 +2778,6 @@ static const struct gdi_dc_funcs xrender_funcs = NULL, /* pSetBkMode */ NULL, /* pSetDCBrushColor */ NULL, /* pSetDCPenColor */ - NULL, /* pSetDIBColorTable */ NULL, /* pSetDIBitsToDevice */ xrenderdrv_SetDeviceClipping, /* pSetDeviceClipping */ NULL, /* pSetDeviceGammaRamp */ diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index a471bf0e60..2ba1b7b2d5 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -165,7 +165,6 @@ struct gdi_dc_funcs INT (*pSetBkMode)(PHYSDEV,INT); COLORREF (*pSetDCBrushColor)(PHYSDEV, COLORREF); COLORREF (*pSetDCPenColor)(PHYSDEV, COLORREF); - UINT (*pSetDIBColorTable)(PHYSDEV,UINT,UINT,const RGBQUAD*); INT (*pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID,BITMAPINFO*,UINT); VOID (*pSetDeviceClipping)(PHYSDEV,HRGN); BOOL (*pSetDeviceGammaRamp)(PHYSDEV,LPVOID); @@ -213,7 +212,7 @@ struct gdi_dc_funcs }; /* increment this when you change the DC function table */ -#define WINE_GDI_DRIVER_VERSION 22 +#define WINE_GDI_DRIVER_VERSION 23 static inline PHYSDEV get_physdev_entry_point( PHYSDEV dev, size_t offset ) {