winex11: Implement the CopyBitmap entry point.

This commit is contained in:
Alexandre Julliard 2011-11-07 22:04:00 +01:00
parent 26f5e2c6e7
commit d9a45745a7
4 changed files with 47 additions and 2 deletions

View file

@ -199,6 +199,42 @@ BOOL X11DRV_CreateBitmap( PHYSDEV dev, HBITMAP hbitmap )
}
/****************************************************************************
* CopyBitmap (X11DRV.@)
*/
BOOL X11DRV_CopyBitmap( HBITMAP src, HBITMAP dst )
{
X_PHYSBITMAP *phys_src, *phys_dst;
BITMAP bitmap;
if (!(phys_src = X11DRV_get_phys_bitmap( src ))) return FALSE;
if (!GetObjectW( dst, sizeof(bitmap), &bitmap )) return FALSE;
TRACE("%p->%p %dx%d %d bpp\n", src, dst, bitmap.bmWidth, bitmap.bmHeight, bitmap.bmBitsPixel);
if (!(phys_dst = X11DRV_init_phys_bitmap( dst ))) return FALSE;
phys_dst->depth = phys_src->depth;
phys_dst->trueColor = phys_src->trueColor;
if (phys_dst->trueColor) phys_dst->color_shifts = phys_src->color_shifts;
wine_tsx11_lock();
phys_dst->pixmap = XCreatePixmap( gdi_display, root_window,
bitmap.bmWidth, bitmap.bmHeight, phys_dst->depth );
XCopyArea( gdi_display, phys_src->pixmap, phys_dst->pixmap,
get_bitmap_gc(phys_dst->depth), 0, 0, bitmap.bmWidth, bitmap.bmHeight, 0, 0 );
wine_tsx11_unlock();
if (!phys_dst->pixmap)
{
WARN("Can't create Pixmap\n");
HeapFree( GetProcessHeap(), 0, phys_dst );
return FALSE;
}
return TRUE;
}
/***********************************************************************
* DeleteBitmap (X11DRV.@)
*/

View file

@ -476,7 +476,7 @@ static const struct gdi_dc_funcs x11drv_funcs =
X11DRV_ChoosePixelFormat, /* pChoosePixelFormat */
X11DRV_Chord, /* pChord */
NULL, /* pCloseFigure */
NULL, /* pCopyBitmap */
X11DRV_CopyBitmap, /* pCopyBitmap */
X11DRV_CreateBitmap, /* pCreateBitmap */
X11DRV_CreateCompatibleDC, /* pCreateCompatibleDC */
X11DRV_CreateDC, /* pCreateDC */

View file

@ -181,6 +181,7 @@ extern BOOL X11DRV_Arc( PHYSDEV dev, INT left, INT top, INT right,
INT bottom, INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_CopyBitmap( HBITMAP src, HBITMAP dst ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_CreateBitmap( PHYSDEV dev, HBITMAP hbitmap ) DECLSPEC_HIDDEN;
extern HBITMAP X11DRV_CreateDIBSection( PHYSDEV dev, HBITMAP hbitmap,
BITMAPINFO *bmi, UINT usage ) DECLSPEC_HIDDEN;

View file

@ -1275,6 +1275,14 @@ static INT xrenderdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID
return dev->funcs->pExtEscape( dev, escape, in_count, in_data, out_count, out_data );
}
/****************************************************************************
* xrenderdrv_CopyBitmap
*/
static BOOL xrenderdrv_CopyBitmap( HBITMAP src, HBITMAP dst )
{
return X11DRV_CopyBitmap( src, dst );
}
/****************************************************************************
* xrenderdrv_CreateBitmap
*/
@ -3060,7 +3068,7 @@ static const struct gdi_dc_funcs xrender_funcs =
NULL, /* pChoosePixelFormat */
NULL, /* pChord */
NULL, /* pCloseFigure */
NULL, /* pCopyBitmap */
xrenderdrv_CopyBitmap, /* pCopyBitmap */
xrenderdrv_CreateBitmap, /* pCreateBitmap */
xrenderdrv_CreateCompatibleDC, /* pCreateCompatibleDC */
xrenderdrv_CreateDC, /* pCreateDC */