From 65997a2a2dcfcdc5fb489f44709a67ac7e236b41 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 25 Jul 2011 19:46:13 +0200 Subject: [PATCH] winex11: Get rid of the no longer used SetDIBits implementation. --- dlls/winex11.drv/dib.c | 117 -------------------------------------- dlls/winex11.drv/init.c | 2 +- dlls/winex11.drv/x11drv.h | 2 - 3 files changed, 1 insertion(+), 120 deletions(-) diff --git a/dlls/winex11.drv/dib.c b/dlls/winex11.drv/dib.c index 7274f0cc589..609e5c2d686 100644 --- a/dlls/winex11.drv/dib.c +++ b/dlls/winex11.drv/dib.c @@ -3954,123 +3954,6 @@ INT X11DRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, DWORD cx, DWORD return result; } -/*********************************************************************** - * SetDIBits (X11DRV.@) - */ -INT X11DRV_SetDIBits( PHYSDEV dev, HBITMAP hbitmap, UINT startscan, - UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse ) -{ - X11DRV_PDEVICE *physDev = get_x11drv_dev( dev ); - X_PHYSBITMAP *physBitmap = X11DRV_get_phys_bitmap( hbitmap ); - X11DRV_DIB_IMAGEBITS_DESCR descr; - DIBSECTION ds; - LONG width, height, tmpheight; - INT result; - - descr.physDev = physDev; - - if (!physBitmap) return 0; - - if (DIB_GetBitmapInfo( &info->bmiHeader, &width, &height, - &descr.infoBpp, &descr.compression ) == -1) - return 0; - - tmpheight = height; - if (height < 0) height = -height; - if (!lines || (startscan >= height)) - return 0; - - if (!GetObjectW( hbitmap, sizeof(ds), &ds )) return 0; - - if (startscan + lines > height) lines = height - startscan; - - switch (descr.infoBpp) - { - case 1: - case 4: - case 8: - descr.colorMap = (RGBQUAD *)X11DRV_DIB_BuildColorMap( - descr.physDev, coloruse, - physBitmap->pixmap_depth, - info, &descr.nColorMap ); - if (!descr.colorMap) return 0; - descr.rMask = descr.gMask = descr.bMask = 0; - break; - case 15: - case 16: - descr.rMask = (descr.compression == BI_BITFIELDS) ? *(const DWORD *)info->bmiColors : 0x7c00; - descr.gMask = (descr.compression == BI_BITFIELDS) ? *((const DWORD *)info->bmiColors + 1) : 0x03e0; - descr.bMask = (descr.compression == BI_BITFIELDS) ? *((const DWORD *)info->bmiColors + 2) : 0x001f; - descr.colorMap = 0; - break; - - case 24: - case 32: - descr.rMask = (descr.compression == BI_BITFIELDS) ? *(const DWORD *)info->bmiColors : 0xff0000; - descr.gMask = (descr.compression == BI_BITFIELDS) ? *((const DWORD *)info->bmiColors + 1) : 0x00ff00; - descr.bMask = (descr.compression == BI_BITFIELDS) ? *((const DWORD *)info->bmiColors + 2) : 0x0000ff; - descr.colorMap = 0; - break; - - default: break; - } - - descr.bits = bits; - descr.image = NULL; - descr.palentry = NULL; - descr.infoWidth = width; - descr.lines = tmpheight >= 0 ? lines : -lines; - descr.depth = physBitmap->pixmap_depth; - descr.shifts = physBitmap->trueColor ? &physBitmap->pixmap_color_shifts : NULL; - descr.drawable = physBitmap->pixmap; - descr.gc = get_bitmap_gc(physBitmap->pixmap_depth); - descr.xSrc = 0; - descr.ySrc = 0; - descr.xDest = 0; - descr.yDest = height - startscan - lines; - descr.width = ds.dsBm.bmWidth; - descr.height = lines; - descr.shm_mode = X11DRV_SHM_NONE; - descr.dibpitch = ((descr.infoWidth * descr.infoBpp + 31) &~31) / 8; - descr.physBitmap = NULL; - X11DRV_DIB_Lock( physBitmap, DIB_Status_GdiMod ); - result = X11DRV_DIB_SetImageBits( &descr ); - - /* optimisation for the case where the input bits are in exactly the same - * format as the internal representation and copying to the app bits is - * cheap - saves a round trip to the X server */ - if (descr.compression == BI_RGB && - coloruse == DIB_RGB_COLORS && - descr.infoBpp == ds.dsBm.bmBitsPixel && - physBitmap->base && physBitmap->size < 65536) - { - unsigned int srcwidthb = X11DRV_DIB_GetDIBWidthBytes( width, descr.infoBpp ); - int dstwidthb = ds.dsBm.bmWidthBytes; - LPBYTE dbits = physBitmap->base + startscan * dstwidthb; - const BYTE *sbits = bits; - int widthb; - UINT y; - - TRACE("syncing compatible set bits to app bits\n"); - if ((tmpheight < 0) ^ physBitmap->topdown) - { - dbits += dstwidthb * (lines-1); - dstwidthb = -dstwidthb; - } - X11DRV_DIB_DoProtectDIBSection( physBitmap, PAGE_READWRITE ); - widthb = min(srcwidthb, abs(dstwidthb)); - for (y = 0; y < lines; y++, dbits += dstwidthb, sbits += srcwidthb) - memcpy(dbits, sbits, widthb); - X11DRV_DIB_DoProtectDIBSection( physBitmap, PAGE_READONLY ); - physBitmap->status = DIB_Status_InSync; - } - X11DRV_DIB_Unlock( physBitmap, TRUE ); - - HeapFree(GetProcessHeap(), 0, descr.colorMap); - - return result; -} - /*********************************************************************** * X11DRV_DIB_DoCopyDIBSection */ diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 4e374c726ee..b3449a8e1fd 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -534,7 +534,7 @@ static const struct gdi_dc_funcs x11drv_funcs = X11DRV_SetDCBrushColor, /* pSetDCBrushColor */ X11DRV_SetDCPenColor, /* pSetDCPenColor */ X11DRV_SetDIBColorTable, /* pSetDIBColorTable */ - X11DRV_SetDIBits, /* pSetDIBits */ + NULL, /* pSetDIBits */ X11DRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */ X11DRV_SetDeviceClipping, /* pSetDeviceClipping */ X11DRV_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */ diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index deec898a3a2..8da451a2f74 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -238,8 +238,6 @@ extern COLORREF X11DRV_SetDCPenColor( PHYSDEV dev, COLORREF crColor ) DECLSPEC_H extern void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN vis_rgn, HRGN clip_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 INT X11DRV_SetDIBits( PHYSDEV dev, HBITMAP hbitmap, UINT startscan, UINT lines, - LPCVOID bits, const BITMAPINFO *info, UINT coloruse ) DECLSPEC_HIDDEN; extern INT X11DRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, DWORD cx, DWORD cy, INT xSrc, INT ySrc, UINT startscan, UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;