Commit 8b5ae114 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use NtGdiStretchBlt for StretchBlt.

parent 7f9d847b
...@@ -579,15 +579,16 @@ BOOL WINAPI DECLSPEC_HOTPATCH BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width, ...@@ -579,15 +579,16 @@ BOOL WINAPI DECLSPEC_HOTPATCH BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
/*********************************************************************** /***********************************************************************
* StretchBlt (GDI32.@) * NtGdiStretchBlt (win32u.@)
*/ */
BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst, INT widthDst, INT heightDst, BOOL WINAPI NtGdiStretchBlt( HDC hdcDst, INT xDst, INT yDst, INT widthDst, INT heightDst,
HDC hdcSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, DWORD rop ) HDC hdcSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc,
DWORD rop, COLORREF bk_color )
{ {
BOOL ret = FALSE; BOOL ret = FALSE;
DC *dcDst, *dcSrc; DC *dcDst, *dcSrc;
if (!rop_uses_src( rop )) return PatBlt( hdcDst, xDst, yDst, widthDst, heightDst, rop ); if (!rop_uses_src( rop )) return NtGdiPatBlt( hdcDst, xDst, yDst, widthDst, heightDst, rop );
if (!(dcDst = get_dc_ptr( hdcDst ))) return FALSE; if (!(dcDst = get_dc_ptr( hdcDst ))) return FALSE;
......
...@@ -210,16 +210,23 @@ BOOL EMFDC_PatBlt( DC_ATTR *dc_attr, INT left, INT top, INT width, INT height, D ...@@ -210,16 +210,23 @@ BOOL EMFDC_PatBlt( DC_ATTR *dc_attr, INT left, INT top, INT width, INT height, D
return ret; return ret;
} }
BOOL CDECL EMFDRV_StretchBlt( PHYSDEV dev_dst, struct bitblt_coords *dst, static inline BOOL rop_uses_src( DWORD rop )
PHYSDEV dev_src, struct bitblt_coords *src, DWORD rop )
{ {
if (src->log_width == dst->log_width && src->log_height == dst->log_height) return ((rop >> 2) & 0x330000) != (rop & 0x330000);
return emfdrv_stretchblt( dev_dst, dst->log_x, dst->log_y, dst->log_width, dst->log_height, }
dev_src->hdc, src->log_x, src->log_y, src->log_width, src->log_height,
rop, EMR_BITBLT ); BOOL EMFDC_StretchBlt( DC_ATTR *dc_attr, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
return emfdrv_stretchblt( dev_dst, dst->log_x, dst->log_y, dst->log_width, dst->log_height, HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src,
dev_src->hdc, src->log_x, src->log_y, src->log_width, src->log_height, DWORD rop )
rop, EMR_STRETCHBLT ); {
if (!rop_uses_src( rop )) return EMFDC_PatBlt( dc_attr, x_dst, y_dst, width_dst, height_dst, rop );
if (width_src == width_dst && height_src == height_dst)
return emfdrv_stretchblt( dc_attr->emf, x_dst, y_dst, width_dst, height_dst,
hdc_src, x_src, y_src, width_src,
height_src, rop, EMR_BITBLT );
return emfdrv_stretchblt( dc_attr->emf, x_dst, y_dst, width_dst, height_dst,
hdc_src, x_src, y_src, width_src,
height_src, rop, EMR_STRETCHBLT );
} }
INT CDECL EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT heightDst, INT CDECL EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT heightDst,
......
...@@ -109,8 +109,6 @@ extern INT CDECL EMFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDes ...@@ -109,8 +109,6 @@ extern INT CDECL EMFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDes
extern COLORREF CDECL EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF CDECL EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_StretchBlt( PHYSDEV devDst, struct bitblt_coords *dst,
PHYSDEV devSrc, struct bitblt_coords *src, DWORD rop ) DECLSPEC_HIDDEN;
extern INT CDECL EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT heightDst, extern INT CDECL EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT heightDst,
INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc,
const void *bits, BITMAPINFO *info, UINT wUsage, DWORD dwRop ) DECLSPEC_HIDDEN; const void *bits, BITMAPINFO *info, UINT wUsage, DWORD dwRop ) DECLSPEC_HIDDEN;
......
...@@ -129,7 +129,7 @@ static const struct gdi_dc_funcs emfdrv_driver = ...@@ -129,7 +129,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
EMFDRV_SetWorldTransform, /* pSetWorldTransform */ EMFDRV_SetWorldTransform, /* pSetWorldTransform */
NULL, /* pStartDoc */ NULL, /* pStartDoc */
NULL, /* pStartPage */ NULL, /* pStartPage */
EMFDRV_StretchBlt, /* pStretchBlt */ NULL, /* pStretchBlt */
EMFDRV_StretchDIBits, /* pStretchDIBits */ EMFDRV_StretchDIBits, /* pStretchDIBits */
EMFDRV_StrokeAndFillPath, /* pStrokeAndFillPath */ EMFDRV_StrokeAndFillPath, /* pStrokeAndFillPath */
EMFDRV_StrokePath, /* pStrokePath */ EMFDRV_StrokePath, /* pStrokePath */
......
...@@ -104,6 +104,9 @@ extern BOOL METADC_SetViewportExtEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; ...@@ -104,6 +104,9 @@ extern BOOL METADC_SetViewportExtEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetViewportOrgEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_SetViewportOrgEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetWindowExtEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_SetWindowExtEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetWindowOrgEx( HDC, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_SetWindowOrgEx( HDC, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_StretchBlt( HDC hdc_dst, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src,
DWORD rop );
/* enhanced metafiles */ /* enhanced metafiles */
extern BOOL EMFDC_AbortPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN; extern BOOL EMFDC_AbortPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN;
...@@ -174,5 +177,8 @@ extern BOOL EMFDC_SetViewportExtEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HI ...@@ -174,5 +177,8 @@ extern BOOL EMFDC_SetViewportExtEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HI
extern BOOL EMFDC_SetViewportOrgEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_SetViewportOrgEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetWindowExtEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_SetWindowExtEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetWindowOrgEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_SetWindowOrgEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_StretchBlt( DC_ATTR *dc_attr, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src,
DWORD rop );
#endif /* __WINE_GDI_PRIVATE_H */ #endif /* __WINE_GDI_PRIVATE_H */
...@@ -1196,6 +1196,28 @@ BOOL WINAPI PatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop ...@@ -1196,6 +1196,28 @@ BOOL WINAPI PatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop
} }
/*********************************************************************** /***********************************************************************
* StretchBlt (GDI32.@)
*/
BOOL WINAPI StretchBlt( HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src,
DWORD rop )
{
DC_ATTR *dc_attr;
if (is_meta_dc( hdc )) return METADC_StretchBlt( hdc, x_dst, y_dst, width_dst, height_dst,
hdc_src, x_src, y_src, width_src,
height_src, rop );
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
if (dc_attr->emf && !EMFDC_StretchBlt( dc_attr, x_dst, y_dst, width_dst, height_dst,
hdc_src, x_src, y_src, width_src,
height_src, rop ))
return FALSE;
return NtGdiStretchBlt( hdc, x_dst, y_dst, width_dst, height_dst,
hdc_src, x_src, y_src, width_src,
height_src, rop, 0 /* FIXME */ );
}
/***********************************************************************
* BeginPath (GDI32.@) * BeginPath (GDI32.@)
*/ */
BOOL WINAPI BeginPath(HDC hdc) BOOL WINAPI BeginPath(HDC hdc)
......
...@@ -89,14 +89,14 @@ static BOOL metadc_stretchblt( HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT ...@@ -89,14 +89,14 @@ static BOOL metadc_stretchblt( HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT
/*********************************************************************** /***********************************************************************
* MFDRV_StretchBlt * METADC_StretchBlt
*/ */
BOOL CDECL MFDRV_StretchBlt( PHYSDEV devDst, struct bitblt_coords *dst, BOOL METADC_StretchBlt( HDC hdc_dst, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
PHYSDEV devSrc, struct bitblt_coords *src, DWORD rop ) HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src,
DWORD rop )
{ {
return metadc_stretchblt( devDst->hdc, dst->log_x, dst->log_y, dst->log_width, dst->log_height, return metadc_stretchblt( hdc_dst, x_dst, y_dst, width_dst, height_dst,
devSrc->hdc, src->log_x, src->log_y, src->log_width, src->log_height, hdc_src, x_src, y_src, width_src, height_src, rop );
rop );
} }
/*********************************************************************** /***********************************************************************
......
...@@ -194,7 +194,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs = ...@@ -194,7 +194,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
NULL, /* pSetWorldTransform */ NULL, /* pSetWorldTransform */
NULL, /* pStartDoc */ NULL, /* pStartDoc */
NULL, /* pStartPage */ NULL, /* pStartPage */
MFDRV_StretchBlt, /* pStretchBlt */ NULL, /* pStretchBlt */
MFDRV_StretchDIBits, /* pStretchDIBits */ MFDRV_StretchDIBits, /* pStretchDIBits */
MFDRV_StrokeAndFillPath, /* pStrokeAndFillPath */ MFDRV_StrokeAndFillPath, /* pStrokeAndFillPath */
MFDRV_StrokePath, /* pStrokePath */ MFDRV_StrokePath, /* pStrokePath */
......
...@@ -97,8 +97,6 @@ extern COLORREF CDECL MFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_H ...@@ -97,8 +97,6 @@ extern COLORREF CDECL MFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_H
extern COLORREF CDECL MFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL MFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF CDECL MFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL MFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF CDECL MFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL MFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_StretchBlt( PHYSDEV devDst, struct bitblt_coords *dst,
PHYSDEV devSrc, struct bitblt_coords *src, DWORD rop ) DECLSPEC_HIDDEN;
extern INT CDECL MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, DWORD cx, extern INT CDECL MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, DWORD cx,
DWORD cy, INT xSrc, INT ySrc, DWORD cy, INT xSrc, INT ySrc,
UINT startscan, UINT lines, LPCVOID bits, UINT startscan, UINT lines, LPCVOID bits,
......
...@@ -267,6 +267,9 @@ BOOL WINAPI NtGdiSetVirtualResolution( HDC hdc, DWORD horz_res, DWORD vert_r ...@@ -267,6 +267,9 @@ BOOL WINAPI NtGdiSetVirtualResolution( HDC hdc, DWORD horz_res, DWORD vert_r
DWORD horz_size, DWORD vert_size ); DWORD horz_size, DWORD vert_size );
INT WINAPI NtGdiStartDoc( HDC hdc, const DOCINFOW *doc ); INT WINAPI NtGdiStartDoc( HDC hdc, const DOCINFOW *doc );
INT WINAPI NtGdiStartPage( HDC hdc ); INT WINAPI NtGdiStartPage( HDC hdc );
BOOL WINAPI NtGdiStretchBlt( HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src,
DWORD rop, COLORREF bk_color );
BOOL WINAPI NtGdiStrokePath( HDC hdc ); BOOL WINAPI NtGdiStrokePath( HDC hdc );
BOOL WINAPI NtGdiStrokeAndFillPath( HDC hdc ); BOOL WINAPI NtGdiStrokeAndFillPath( HDC hdc );
BOOL WINAPI NtGdiTransformPoints( HDC hdc, const POINT *points_in, POINT *points_out, BOOL WINAPI NtGdiTransformPoints( HDC hdc, const POINT *points_in, POINT *points_out,
......
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