gdi32: Get rid of the SetDIBColorTable driver entry point.

This commit is contained in:
Alexandre Julliard 2012-01-07 13:27:08 +01:00
parent b00e7039c5
commit dc1aeeb2f8
11 changed files with 9 additions and 70 deletions

View File

@ -898,8 +898,6 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, CONST RGBQUA
if ((bitmap = GDI_GetObjPtr( dc->hBitmap, OBJ_BITMAP ))) if ((bitmap = GDI_GetObjPtr( dc->hBitmap, OBJ_BITMAP )))
{ {
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetDIBColorTable );
/* Check if currently selected bitmap is a DIB */ /* Check if currently selected bitmap is a DIB */
if (bitmap->color_table) if (bitmap->color_table)
{ {
@ -910,7 +908,14 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, CONST RGBQUA
} }
} }
GDI_ReleaseObj( dc->hBitmap ); 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 ); release_dc_ptr( dc );
return result; return result;

View File

@ -381,24 +381,6 @@ static void dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn )
return next->funcs->pSetDeviceClipping( next, 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 * dibdrv_ChoosePixelFormat
*/ */
@ -684,7 +666,6 @@ const struct gdi_dc_funcs dib_driver =
NULL, /* pSetBkMode */ NULL, /* pSetBkMode */
dibdrv_SetDCBrushColor, /* pSetDCBrushColor */ dibdrv_SetDCBrushColor, /* pSetDCBrushColor */
dibdrv_SetDCPenColor, /* pSetDCPenColor */ dibdrv_SetDCPenColor, /* pSetDCPenColor */
dibdrv_SetDIBColorTable, /* pSetDIBColorTable */
NULL, /* pSetDIBitsToDevice */ NULL, /* pSetDIBitsToDevice */
dibdrv_SetDeviceClipping, /* pSetDeviceClipping */ dibdrv_SetDeviceClipping, /* pSetDeviceClipping */
dibdrv_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */ dibdrv_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */

View File

@ -572,11 +572,6 @@ static COLORREF nulldrv_SetDCPenColor( PHYSDEV dev, COLORREF color )
return 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 ) static void nulldrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn )
{ {
} }
@ -832,7 +827,6 @@ const struct gdi_dc_funcs null_driver =
nulldrv_SetBkMode, /* pSetBkMode */ nulldrv_SetBkMode, /* pSetBkMode */
nulldrv_SetDCBrushColor, /* pSetDCBrushColor */ nulldrv_SetDCBrushColor, /* pSetDCBrushColor */
nulldrv_SetDCPenColor, /* pSetDCPenColor */ nulldrv_SetDCPenColor, /* pSetDCPenColor */
nulldrv_SetDIBColorTable, /* pSetDIBColorTable */
nulldrv_SetDIBitsToDevice, /* pSetDIBitsToDevice */ nulldrv_SetDIBitsToDevice, /* pSetDIBitsToDevice */
nulldrv_SetDeviceClipping, /* pSetDeviceClipping */ nulldrv_SetDeviceClipping, /* pSetDeviceClipping */
nulldrv_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */ nulldrv_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */

View File

@ -139,7 +139,6 @@ static const struct gdi_dc_funcs EMFDRV_Funcs =
EMFDRV_SetBkMode, /* pSetBkMode */ EMFDRV_SetBkMode, /* pSetBkMode */
EMFDRV_SetDCBrushColor, /* pSetDCBrushColor*/ EMFDRV_SetDCBrushColor, /* pSetDCBrushColor*/
EMFDRV_SetDCPenColor, /* pSetDCPenColor*/ EMFDRV_SetDCPenColor, /* pSetDCPenColor*/
NULL, /* pSetDIBColorTable */
EMFDRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */ EMFDRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */
NULL, /* pSetDeviceClipping */ NULL, /* pSetDeviceClipping */
NULL, /* pSetDeviceGammaRamp */ NULL, /* pSetDeviceGammaRamp */

View File

@ -184,7 +184,6 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
MFDRV_SetBkMode, /* pSetBkMode */ MFDRV_SetBkMode, /* pSetBkMode */
MFDRV_SetDCBrushColor, /* pSetDCBrushColor*/ MFDRV_SetDCBrushColor, /* pSetDCBrushColor*/
MFDRV_SetDCPenColor, /* pSetDCPenColor*/ MFDRV_SetDCPenColor, /* pSetDCPenColor*/
NULL, /* pSetDIBColorTable */
MFDRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */ MFDRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */
NULL, /* pSetDeviceClipping */ NULL, /* pSetDeviceClipping */
NULL, /* pSetDeviceGammaRamp */ NULL, /* pSetDeviceGammaRamp */

View File

@ -922,7 +922,6 @@ static const struct gdi_dc_funcs psdrv_funcs =
NULL, /* pSetBkMode */ NULL, /* pSetBkMode */
PSDRV_SetDCBrushColor, /* pSetDCBrushColor */ PSDRV_SetDCBrushColor, /* pSetDCBrushColor */
PSDRV_SetDCPenColor, /* pSetDCPenColor */ PSDRV_SetDCPenColor, /* pSetDCPenColor */
NULL, /* pSetDIBColorTable */
NULL, /* pSetDIBitsToDevice */ NULL, /* pSetDIBitsToDevice */
NULL, /* pSetDeviceClipping */ NULL, /* pSetDeviceClipping */
NULL, /* pSetDeviceGammaRamp */ NULL, /* pSetDeviceGammaRamp */

View File

@ -4016,40 +4016,6 @@ void X11DRV_DIB_DeleteDIBSection(X_PHYSBITMAP *physBitmap, DIBSECTION *dib)
DeleteCriticalSection(&physBitmap->lock); 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 * X11DRV_DIB_CreateDIBFromBitmap

View File

@ -561,7 +561,6 @@ static const struct gdi_dc_funcs x11drv_funcs =
NULL, /* pSetBkMode */ NULL, /* pSetBkMode */
X11DRV_SetDCBrushColor, /* pSetDCBrushColor */ X11DRV_SetDCBrushColor, /* pSetDCBrushColor */
X11DRV_SetDCPenColor, /* pSetDCPenColor */ X11DRV_SetDCPenColor, /* pSetDCPenColor */
X11DRV_SetDIBColorTable, /* pSetDIBColorTable */
NULL, /* pSetDIBitsToDevice */ NULL, /* pSetDIBitsToDevice */
X11DRV_SetDeviceClipping, /* pSetDeviceClipping */ X11DRV_SetDeviceClipping, /* pSetDeviceClipping */
X11DRV_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */ X11DRV_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */

View File

@ -230,7 +230,6 @@ extern COLORREF X11DRV_SetDCBrushColor( PHYSDEV dev, COLORREF crColor ) DECLSPEC
extern COLORREF X11DRV_SetDCPenColor( PHYSDEV dev, COLORREF crColor ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_SetDCPenColor( PHYSDEV dev, COLORREF crColor ) DECLSPEC_HIDDEN;
extern void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) DECLSPEC_HIDDEN; extern void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_SetDeviceGammaRamp( PHYSDEV dev, LPVOID ramp ) 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 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 BOOL X11DRV_SetPixelFormat(PHYSDEV dev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) DECLSPEC_HIDDEN;
extern COLORREF X11DRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;

View File

@ -2778,7 +2778,6 @@ static const struct gdi_dc_funcs xrender_funcs =
NULL, /* pSetBkMode */ NULL, /* pSetBkMode */
NULL, /* pSetDCBrushColor */ NULL, /* pSetDCBrushColor */
NULL, /* pSetDCPenColor */ NULL, /* pSetDCPenColor */
NULL, /* pSetDIBColorTable */
NULL, /* pSetDIBitsToDevice */ NULL, /* pSetDIBitsToDevice */
xrenderdrv_SetDeviceClipping, /* pSetDeviceClipping */ xrenderdrv_SetDeviceClipping, /* pSetDeviceClipping */
NULL, /* pSetDeviceGammaRamp */ NULL, /* pSetDeviceGammaRamp */

View File

@ -165,7 +165,6 @@ struct gdi_dc_funcs
INT (*pSetBkMode)(PHYSDEV,INT); INT (*pSetBkMode)(PHYSDEV,INT);
COLORREF (*pSetDCBrushColor)(PHYSDEV, COLORREF); COLORREF (*pSetDCBrushColor)(PHYSDEV, COLORREF);
COLORREF (*pSetDCPenColor)(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); INT (*pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID,BITMAPINFO*,UINT);
VOID (*pSetDeviceClipping)(PHYSDEV,HRGN); VOID (*pSetDeviceClipping)(PHYSDEV,HRGN);
BOOL (*pSetDeviceGammaRamp)(PHYSDEV,LPVOID); BOOL (*pSetDeviceGammaRamp)(PHYSDEV,LPVOID);
@ -213,7 +212,7 @@ struct gdi_dc_funcs
}; };
/* increment this when you change the DC function table */ /* 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 ) static inline PHYSDEV get_physdev_entry_point( PHYSDEV dev, size_t offset )
{ {