Commit ab15d132 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 3fe20bdc
......@@ -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 );
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 );
......
......@@ -36,18 +36,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,
* decide between rdFunction values META_STRETCHBLT or META_DIBSTRETCHBLT
......
......@@ -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 */
......
......@@ -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;
......
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