Commit d9a45745 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Implement the CopyBitmap entry point.

parent 26f5e2c6
......@@ -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.@)
*/
......
......@@ -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 */
......
......@@ -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;
......
......@@ -1276,6 +1276,14 @@ static INT xrenderdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID
}
/****************************************************************************
* xrenderdrv_CopyBitmap
*/
static BOOL xrenderdrv_CopyBitmap( HBITMAP src, HBITMAP dst )
{
return X11DRV_CopyBitmap( src, dst );
}
/****************************************************************************
* xrenderdrv_CreateBitmap
*/
static BOOL xrenderdrv_CreateBitmap( PHYSDEV dev, HBITMAP hbitmap )
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment