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

This commit is contained in:
Alexandre Julliard 2011-11-07 22:14:50 +01:00
parent 9391c6a757
commit 26f5e2c6e7
4 changed files with 31 additions and 6 deletions

View File

@ -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.@]

View File

@ -390,6 +390,14 @@ static BOOL dibdrv_DeleteDC( PHYSDEV dev )
return TRUE;
}
/***********************************************************************
* dibdrv_CopyBitmap
*/
static BOOL dibdrv_CopyBitmap( HBITMAP src, HBITMAP dst )
{
return nulldrv_CopyBitmap( src, dst );
}
/***********************************************************************
* dibdrv_DeleteBitmap
*/
@ -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 */

View File

@ -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;

View File

@ -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;