winex11: Get rid of the no longer used GetBitmapBits implementation.
This commit is contained in:
parent
1724c73534
commit
96c1b3bbc2
|
@ -204,129 +204,6 @@ BOOL X11DRV_CreateBitmap( PHYSDEV dev, HBITMAP hbitmap, LPVOID bmBits )
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetBitmapBits (X11DRV.@)
|
||||
*
|
||||
* RETURNS
|
||||
* Success: Number of bytes copied
|
||||
* Failure: 0
|
||||
*/
|
||||
LONG X11DRV_GetBitmapBits( HBITMAP hbitmap, void *buffer, LONG count )
|
||||
{
|
||||
BITMAP bitmap;
|
||||
X_PHYSBITMAP *physBitmap = X11DRV_get_phys_bitmap( hbitmap );
|
||||
LONG height;
|
||||
XImage *image;
|
||||
LPBYTE tbuf, startline;
|
||||
int h, w;
|
||||
|
||||
if (!physBitmap || !GetObjectW( hbitmap, sizeof(bitmap), &bitmap )) return 0;
|
||||
|
||||
TRACE("(bmp=%p, buffer=%p, count=0x%x)\n", hbitmap, buffer, count);
|
||||
|
||||
wine_tsx11_lock();
|
||||
height = count / bitmap.bmWidthBytes;
|
||||
image = XGetImage( gdi_display, physBitmap->pixmap, 0, 0,
|
||||
bitmap.bmWidth, height, AllPlanes, ZPixmap );
|
||||
|
||||
/* copy XImage to 16 bit padded image buffer with real bitsperpixel */
|
||||
|
||||
startline = buffer;
|
||||
switch (bitmap.bmBitsPixel)
|
||||
{
|
||||
case 1:
|
||||
for (h=0;h<height;h++)
|
||||
{
|
||||
tbuf = startline;
|
||||
*tbuf = 0;
|
||||
for (w=0;w<bitmap.bmWidth;w++)
|
||||
{
|
||||
if ((w%8) == 0)
|
||||
*tbuf = 0;
|
||||
*tbuf |= XGetPixel(image,w,h)<<(7-(w&7));
|
||||
if ((w&7) == 7) ++tbuf;
|
||||
}
|
||||
startline += bitmap.bmWidthBytes;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
for (h=0;h<height;h++)
|
||||
{
|
||||
tbuf = startline;
|
||||
for (w=0;w<bitmap.bmWidth;w++)
|
||||
{
|
||||
if (!(w & 1)) *tbuf = XGetPixel( image, w, h) << 4;
|
||||
else *tbuf++ |= XGetPixel( image, w, h) & 0x0f;
|
||||
}
|
||||
startline += bitmap.bmWidthBytes;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
for (h=0;h<height;h++)
|
||||
{
|
||||
tbuf = startline;
|
||||
for (w=0;w<bitmap.bmWidth;w++)
|
||||
*tbuf++ = XGetPixel(image,w,h);
|
||||
startline += bitmap.bmWidthBytes;
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
case 16:
|
||||
for (h=0;h<height;h++)
|
||||
{
|
||||
tbuf = startline;
|
||||
for (w=0;w<bitmap.bmWidth;w++)
|
||||
{
|
||||
long pixel = XGetPixel(image,w,h);
|
||||
|
||||
*tbuf++ = pixel & 0xff;
|
||||
*tbuf++ = (pixel>>8) & 0xff;
|
||||
}
|
||||
startline += bitmap.bmWidthBytes;
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
for (h=0;h<height;h++)
|
||||
{
|
||||
tbuf = startline;
|
||||
for (w=0;w<bitmap.bmWidth;w++)
|
||||
{
|
||||
long pixel = XGetPixel(image,w,h);
|
||||
|
||||
*tbuf++ = pixel & 0xff;
|
||||
*tbuf++ = (pixel>> 8) & 0xff;
|
||||
*tbuf++ = (pixel>>16) & 0xff;
|
||||
}
|
||||
startline += bitmap.bmWidthBytes;
|
||||
}
|
||||
break;
|
||||
|
||||
case 32:
|
||||
for (h=0;h<height;h++)
|
||||
{
|
||||
tbuf = startline;
|
||||
for (w=0;w<bitmap.bmWidth;w++)
|
||||
{
|
||||
long pixel = XGetPixel(image,w,h);
|
||||
|
||||
*tbuf++ = pixel & 0xff;
|
||||
*tbuf++ = (pixel>> 8) & 0xff;
|
||||
*tbuf++ = (pixel>>16) & 0xff;
|
||||
*tbuf++ = (pixel>>24) & 0xff;
|
||||
}
|
||||
startline += bitmap.bmWidthBytes;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
FIXME("Unhandled bits:%d\n", bitmap.bmBitsPixel);
|
||||
}
|
||||
XDestroyImage( image );
|
||||
wine_tsx11_unlock();
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* SetBitmapBits (X11DRV.@)
|
||||
*
|
||||
|
|
|
@ -480,7 +480,7 @@ static const struct gdi_dc_funcs x11drv_funcs =
|
|||
NULL, /* pFlattenPath */
|
||||
NULL, /* pFrameRgn */
|
||||
NULL, /* pGdiComment */
|
||||
X11DRV_GetBitmapBits, /* pGetBitmapBits */
|
||||
NULL, /* pGetBitmapBits */
|
||||
X11DRV_GetCharWidth, /* pGetCharWidth */
|
||||
X11DRV_GetDeviceCaps, /* pGetDeviceCaps */
|
||||
X11DRV_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */
|
||||
|
|
|
@ -198,7 +198,6 @@ extern INT X11DRV_EnumICMProfiles( PHYSDEV dev, ICMENUMPROCW proc, LPARAM lparam
|
|||
extern BOOL X11DRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) DECLSPEC_HIDDEN;
|
||||
extern BOOL X11DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprect,
|
||||
LPCWSTR str, UINT count, const INT *lpDx ) DECLSPEC_HIDDEN;
|
||||
extern LONG X11DRV_GetBitmapBits( HBITMAP hbitmap, void *bits, LONG count ) DECLSPEC_HIDDEN;
|
||||
extern BOOL X11DRV_GetCharWidth( PHYSDEV dev, UINT firstChar, UINT lastChar, LPINT buffer ) DECLSPEC_HIDDEN;
|
||||
extern BOOL X11DRV_GetDeviceGammaRamp( PHYSDEV dev, LPVOID ramp ) DECLSPEC_HIDDEN;
|
||||
extern BOOL X11DRV_GetICMProfile( PHYSDEV dev, LPDWORD size, LPWSTR filename ) DECLSPEC_HIDDEN;
|
||||
|
|
Loading…
Reference in New Issue