Commit 26f5e2c6 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Implement the CopyBitmap entry point in the null driver.

parent 9391c6a7
......@@ -65,6 +65,27 @@ DWORD nulldrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *inf
return dib_driver.pPutImage( NULL, hbitmap, clip, info, bits, src, dst, rop );
}
BOOL nulldrv_CopyBitmap( HBITMAP src, HBITMAP dst )
{
BOOL ret = TRUE;
BITMAPOBJ *src_bmp = GDI_GetObjPtr( src, OBJ_BITMAP );
if (!src_bmp) return FALSE;
if (src_bmp->bitmap.bmBits)
{
BITMAPOBJ *dst_bmp = GDI_GetObjPtr( dst, OBJ_BITMAP );
int stride = get_dib_stride( dst_bmp->bitmap.bmWidth, dst_bmp->bitmap.bmBitsPixel );
dst_bmp->bitmap.bmBits = HeapAlloc( GetProcessHeap(), 0, dst_bmp->bitmap.bmHeight * stride );
if (dst_bmp->bitmap.bmBits)
memcpy( dst_bmp->bitmap.bmBits, src_bmp->bitmap.bmBits, dst_bmp->bitmap.bmHeight * stride );
else
ret = FALSE;
GDI_ReleaseObj( dst );
}
GDI_ReleaseObj( src );
return ret;
}
/******************************************************************************
* CreateBitmap [GDI32.@]
......
......@@ -391,6 +391,14 @@ static BOOL dibdrv_DeleteDC( PHYSDEV dev )
}
/***********************************************************************
* dibdrv_CopyBitmap
*/
static BOOL dibdrv_CopyBitmap( HBITMAP src, HBITMAP dst )
{
return nulldrv_CopyBitmap( src, dst );
}
/***********************************************************************
* dibdrv_DeleteBitmap
*/
static BOOL dibdrv_DeleteBitmap( HBITMAP bitmap )
......@@ -523,7 +531,7 @@ const struct gdi_dc_funcs dib_driver =
NULL, /* pChoosePixelFormat */
NULL, /* pChord */
NULL, /* pCloseFigure */
NULL, /* pCopyBitmap */
dibdrv_CopyBitmap, /* pCopyBitmap */
NULL, /* pCreateBitmap */
NULL, /* pCreateCompatibleDC */
dibdrv_CreateDC, /* pCreateDC */
......
......@@ -209,11 +209,6 @@ static BOOL nulldrv_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom
return TRUE;
}
static BOOL nulldrv_CopyBitmap( HBITMAP src, HBITMAP dst )
{
return TRUE;
}
static BOOL nulldrv_CreateBitmap( PHYSDEV dev, HBITMAP bitmap )
{
return TRUE;
......
......@@ -357,6 +357,7 @@ extern BOOL nulldrv_BeginPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern DWORD nulldrv_BlendImage( PHYSDEV dev, BITMAPINFO *info, const struct gdi_image_bits *bits,
struct bitblt_coords *src, struct bitblt_coords *dst, BLENDFUNCTION func ) DECLSPEC_HIDDEN;
extern BOOL nulldrv_CloseFigure( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL nulldrv_CopyBitmap( HBITMAP src, HBITMAP dst ) DECLSPEC_HIDDEN;
extern BOOL nulldrv_EndPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern INT nulldrv_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
extern INT nulldrv_ExtSelectClipRgn( PHYSDEV dev, HRGN rgn, INT mode ) DECLSPEC_HIDDEN;
......
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