gdi32: Fall back to StretchBlt if the driver doesn't export PatBlt or BitBlt.

This commit is contained in:
Alexandre Julliard 2009-09-30 20:55:26 +02:00
parent 3fe20bdc7e
commit ab15d13290
4 changed files with 16 additions and 20 deletions

View File

@ -47,12 +47,18 @@ BOOL WINAPI PatBlt( HDC hdc, INT left, INT top,
if (!dc) return FALSE;
TRACE("%p %d,%d %dx%d %06x\n", hdc, left, top, width, height, rop );
if (dc->funcs->pPatBlt)
{
TRACE("%p %d,%d %dx%d %06x\n", hdc, left, top, width, height, rop );
update_dc( dc );
bRet = dc->funcs->pPatBlt( dc->physDev, left, top, width, height, rop );
}
else if (dc->funcs->pStretchBlt)
{
update_dc( dc );
bRet = dc->funcs->pStretchBlt( dc->physDev, left, top, width, height, NULL, 0, 0, 0, 0, rop );
}
release_dc_ptr( dc );
return bRet;
}
@ -72,14 +78,19 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
if (!(dcDst = get_dc_ptr( hdcDst ))) return FALSE;
if (dcDst->funcs->pBitBlt)
if (dcDst->funcs->pBitBlt || dcDst->funcs->pStretchBlt)
{
update_dc( dcDst );
dcSrc = get_dc_ptr( hdcSrc );
if (dcSrc) update_dc( dcSrc );
ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height,
dcSrc ? dcSrc->physDev : NULL, xSrc, ySrc, rop );
if (dcDst->funcs->pBitBlt)
ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height,
dcSrc ? dcSrc->physDev : NULL, xSrc, ySrc, rop );
else
ret = dcDst->funcs->pStretchBlt( dcDst->physDev, xDst, yDst, width, height,
dcSrc ? dcSrc->physDev : NULL, xSrc, ySrc,
width, height, rop );
release_dc_ptr( dcDst );
if (dcSrc) release_dc_ptr( dcSrc );

View File

@ -35,18 +35,6 @@ BOOL CDECL MFDRV_PatBlt( PHYSDEV dev, INT left, INT top, INT width, INT height,
}
/***********************************************************************
* MFDRV_BitBlt
*/
BOOL CDECL MFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width, INT height,
PHYSDEV devSrc, INT xSrc, INT ySrc, DWORD rop )
{
return MFDRV_StretchBlt(devDst, xDst, yDst, width, height, devSrc,
xSrc, ySrc, width, height, rop);
}
/***********************************************************************
* MFDRV_StretchBlt
* this function contains TWO ways for processing StretchBlt in metafiles,

View File

@ -38,7 +38,7 @@ static const DC_FUNCTIONS MFDRV_Funcs =
MFDRV_Arc, /* pArc */
NULL, /* pArcTo */
MFDRV_BeginPath, /* pBeginPath */
MFDRV_BitBlt, /* pBitBlt */
NULL, /* pBitBlt */
NULL, /* pChoosePixelFormat */
MFDRV_Chord, /* pChord */
MFDRV_CloseFigure, /* pCloseFigure */

View File

@ -64,9 +64,6 @@ extern BOOL CDECL MFDRV_AbortPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_BeginPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width,
INT height, PHYSDEV devSrc, INT xSrc, INT ySrc,
DWORD rop ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right,
INT bottom, INT xstart, INT ystart, INT xend,
INT yend ) DECLSPEC_HIDDEN;