From 6d00196aead1b1dae4263fff6e36bc08e545b8a2 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 3 Aug 2011 11:46:08 +0200 Subject: [PATCH] gdi32: Get rid of the SetBitmapBits driver entry point. --- dlls/gdi32/bitmap.c | 19 ------ dlls/gdi32/dibdrv/dc.c | 1 - dlls/gdi32/driver.c | 1 - dlls/gdi32/enhmfdrv/init.c | 1 - dlls/gdi32/gdi_private.h | 1 - dlls/gdi32/mfdrv/init.c | 1 - dlls/wineps.drv/init.c | 1 - dlls/winex11.drv/bitmap.c | 123 ------------------------------------- dlls/winex11.drv/init.c | 1 - dlls/winex11.drv/x11drv.h | 1 - include/wine/gdi_driver.h | 3 +- 11 files changed, 1 insertion(+), 152 deletions(-) diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index 5970d7f98c2..cfe9fc1e4e6 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -50,25 +50,6 @@ static const struct gdi_obj_funcs bitmap_funcs = * null driver fallback implementations */ -LONG nulldrv_SetBitmapBits( HBITMAP bitmap, const void *bits, LONG size ) -{ - BITMAPOBJ *bmp = GDI_GetObjPtr( bitmap, OBJ_BITMAP ); - - if (!bmp->bitmap.bmBits) - { - LONG total = bmp->bitmap.bmHeight * bmp->bitmap.bmWidthBytes; /* alloc enough for entire bitmap */ - if (!(bmp->bitmap.bmBits = HeapAlloc( GetProcessHeap(), 0, total ))) - { - GDI_ReleaseObj( bitmap ); - return 0; - } - if (size < total) memset( (char *)bmp->bitmap.bmBits + size, 0, total - size ); - } - memcpy( bmp->bitmap.bmBits, bits, size ); - GDI_ReleaseObj( bitmap ); - return size; -} - DWORD nulldrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, struct gdi_image_bits *bits, struct bitblt_coords *src ) { diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index d9a2443a902..a8d197b3a75 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -821,7 +821,6 @@ const DC_FUNCTIONS dib_driver = NULL, /* pSelectPalette */ dibdrv_SelectPen, /* pSelectPen */ NULL, /* pSetArcDirection */ - NULL, /* pSetBitmapBits */ dibdrv_SetBkColor, /* pSetBkColor */ dibdrv_SetBkMode, /* pSetBkMode */ dibdrv_SetDCBrushColor, /* pSetDCBrushColor */ diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index 9d958d8c322..72b93dd9ff5 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -742,7 +742,6 @@ const DC_FUNCTIONS null_driver = nulldrv_SelectPalette, /* pSelectPalette */ nulldrv_SelectPen, /* pSelectPen */ nulldrv_SetArcDirection, /* pSetArcDirection */ - nulldrv_SetBitmapBits, /* pSetBitmapBits */ nulldrv_SetBkColor, /* pSetBkColor */ nulldrv_SetBkMode, /* pSetBkMode */ nulldrv_SetDCBrushColor, /* pSetDCBrushColor */ diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index a73ea0010a0..9f808544c4f 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -118,7 +118,6 @@ static const DC_FUNCTIONS EMFDRV_Funcs = EMFDRV_SelectPalette, /* pSelectPalette */ EMFDRV_SelectPen, /* pSelectPen */ EMFDRV_SetArcDirection, /* pSetArcDirection */ - NULL, /* pSetBitmapBits */ EMFDRV_SetBkColor, /* pSetBkColor */ EMFDRV_SetBkMode, /* pSetBkMode */ EMFDRV_SetDCBrushColor, /* pSetDCBrushColor*/ diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index ed5bb8a5f2e..4479316c3dd 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -501,7 +501,6 @@ extern INT nulldrv_SaveDC( PHYSDEV dev ) DECLSPEC_HIDDEN; extern BOOL nulldrv_ScaleViewportExtEx( PHYSDEV dev, INT x_num, INT x_denom, INT y_num, INT y_denom, SIZE *size ) DECLSPEC_HIDDEN; extern BOOL nulldrv_ScaleWindowExtEx( PHYSDEV dev, INT x_num, INT x_denom, INT y_num, INT y_denom, SIZE *size ) DECLSPEC_HIDDEN; extern BOOL nulldrv_SelectClipPath( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; -extern LONG nulldrv_SetBitmapBits( HBITMAP bitmap, const void *bits, LONG size ) DECLSPEC_HIDDEN; extern INT nulldrv_SetMapMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; extern BOOL nulldrv_SetViewportExtEx( PHYSDEV dev, INT cx, INT cy, SIZE *size ) DECLSPEC_HIDDEN; extern BOOL nulldrv_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index 83edb1bb564..dca30db34d2 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -162,7 +162,6 @@ static const DC_FUNCTIONS MFDRV_Funcs = MFDRV_SelectPalette, /* pSelectPalette */ MFDRV_SelectPen, /* pSelectPen */ NULL, /* pSetArcDirection */ - NULL, /* pSetBitmapBits */ MFDRV_SetBkColor, /* pSetBkColor */ MFDRV_SetBkMode, /* pSetBkMode */ MFDRV_SetDCBrushColor, /* pSetDCBrushColor*/ diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index 554e0f8efcb..b34bd8a8a7a 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -884,7 +884,6 @@ static const struct gdi_dc_funcs psdrv_funcs = NULL, /* pSelectPalette */ PSDRV_SelectPen, /* pSelectPen */ NULL, /* pSetArcDirection */ - NULL, /* pSetBitmapBits */ PSDRV_SetBkColor, /* pSetBkColor */ NULL, /* pSetBkMode */ PSDRV_SetDCBrushColor, /* pSetDCBrushColor */ diff --git a/dlls/winex11.drv/bitmap.c b/dlls/winex11.drv/bitmap.c index 503f3bb69d4..af6266b4ee7 100644 --- a/dlls/winex11.drv/bitmap.c +++ b/dlls/winex11.drv/bitmap.c @@ -196,129 +196,6 @@ BOOL X11DRV_CreateBitmap( PHYSDEV dev, HBITMAP hbitmap ) } -/****************************************************************************** - * SetBitmapBits (X11DRV.@) - * - * RETURNS - * Success: Number of bytes used in setting the bitmap bits - * Failure: 0 - */ -LONG X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count ) -{ - BITMAP bitmap; - X_PHYSBITMAP *physBitmap = X11DRV_get_phys_bitmap( hbitmap ); - LONG height; - XImage *image; - const BYTE *sbuf, *startline; - int w, h; - - if (!physBitmap || !GetObjectW( hbitmap, sizeof(bitmap), &bitmap )) return 0; - - TRACE("(bmp=%p, bits=%p, count=0x%x)\n", hbitmap, bits, count); - - height = count / bitmap.bmWidthBytes; - - wine_tsx11_lock(); - image = XCreateImage( gdi_display, visual, physBitmap->pixmap_depth, ZPixmap, 0, NULL, - bitmap.bmWidth, height, 32, 0 ); - if (!(image->data = HeapAlloc( GetProcessHeap(), 0, image->bytes_per_line * height ))) - { - WARN("No memory to create image data.\n"); - XDestroyImage( image ); - wine_tsx11_unlock(); - return 0; - } - - /* copy 16 bit padded image buffer with real bitsperpixel to XImage */ - - startline = bits; - - switch (bitmap.bmBitsPixel) - { - case 1: - for (h=0;h>(7-(w&7))) & 1); - if ((w&7) == 7) - sbuf++; - } - startline += bitmap.bmWidthBytes; - } - break; - case 4: - for (h=0;h> 4 ); - else XPutPixel( image, w, h, *sbuf++ & 0xf ); - } - startline += bitmap.bmWidthBytes; - } - break; - case 8: - for (h=0;hpixmap, get_bitmap_gc(physBitmap->pixmap_depth), - image, 0, 0, 0, 0, bitmap.bmWidth, height ); - HeapFree( GetProcessHeap(), 0, image->data ); - image->data = NULL; - XDestroyImage( image ); - wine_tsx11_unlock(); - return count; -} - /*********************************************************************** * DeleteBitmap (X11DRV.@) */ diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index d73b91f3726..111676c8470 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -527,7 +527,6 @@ static const struct gdi_dc_funcs x11drv_funcs = NULL, /* pSelectPalette */ X11DRV_SelectPen, /* pSelectPen */ NULL, /* pSetArcDirection */ - X11DRV_SetBitmapBits, /* pSetBitmapBits */ X11DRV_SetBkColor, /* pSetBkColor */ NULL, /* pSetBkMode */ X11DRV_SetDCBrushColor, /* pSetDCBrushColor */ diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index d54dda785be..260c0a42cda 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -230,7 +230,6 @@ extern HBITMAP X11DRV_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap ) DECLSPEC_HIDD extern HBRUSH X11DRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush ) DECLSPEC_HIDDEN; extern HFONT X11DRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont ) DECLSPEC_HIDDEN; extern HPEN X11DRV_SelectPen( PHYSDEV dev, HPEN hpen ) DECLSPEC_HIDDEN; -extern LONG X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_SetDCBrushColor( PHYSDEV dev, COLORREF crColor ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_SetDCPenColor( PHYSDEV dev, COLORREF crColor ) DECLSPEC_HIDDEN; diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 5cd867ee14c..4c5e9f0a0cd 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -136,7 +136,6 @@ struct gdi_dc_funcs HPALETTE (*pSelectPalette)(PHYSDEV,HPALETTE,BOOL); HPEN (*pSelectPen)(PHYSDEV,HPEN); INT (*pSetArcDirection)(PHYSDEV,INT); - LONG (*pSetBitmapBits)(HBITMAP,const void*,LONG); COLORREF (*pSetBkColor)(PHYSDEV,COLORREF); INT (*pSetBkMode)(PHYSDEV,INT); COLORREF (*pSetDCBrushColor)(PHYSDEV, COLORREF); @@ -189,7 +188,7 @@ struct gdi_dc_funcs }; /* increment this when you change the DC function table */ -#define WINE_GDI_DRIVER_VERSION 10 +#define WINE_GDI_DRIVER_VERSION 11 static inline PHYSDEV get_physdev_entry_point( PHYSDEV dev, size_t offset ) {