winex11: Get rid of the no longer used SetDIBits implementation.
This commit is contained in:
parent
9d7d37fd09
commit
65997a2a2d
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue