gdi32: Handle metafiles directly in MoveToEx implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
68b6cca258
commit
95b3504e1e
|
@ -38,5 +38,6 @@ static inline BOOL is_meta_dc( HDC hdc )
|
|||
}
|
||||
|
||||
extern BOOL METADC_LineTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
|
||||
extern BOOL METADC_MoveTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
|
||||
|
||||
#endif /* __WINE_GDI_PRIVATE_H */
|
||||
|
|
|
@ -42,6 +42,8 @@ BOOL WINAPI LineTo( HDC hdc, INT x, INT y )
|
|||
BOOL WINAPI MoveToEx( HDC hdc, INT x, INT y, POINT *pt )
|
||||
{
|
||||
TRACE( "%p, (%d, %d), %p\n", hdc, x, y, pt );
|
||||
|
||||
if (is_meta_dc( hdc )) return METADC_MoveTo( hdc, x, y );
|
||||
return NtGdiMoveTo( hdc, x, y, pt );
|
||||
}
|
||||
|
||||
|
|
|
@ -31,11 +31,11 @@
|
|||
WINE_DEFAULT_DEBUG_CHANNEL(metafile);
|
||||
|
||||
/**********************************************************************
|
||||
* MFDRV_MoveTo
|
||||
* METADC_MoveTo
|
||||
*/
|
||||
BOOL CDECL MFDRV_MoveTo(PHYSDEV dev, INT x, INT y)
|
||||
BOOL METADC_MoveTo( HDC hdc, INT x, INT y )
|
||||
{
|
||||
return MFDRV_MetaParam2(dev,META_MOVETO,x,y);
|
||||
return metadc_param2( hdc, META_MOVETO, x, y );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
|
@ -161,7 +161,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
|
|||
MFDRV_InvertRgn, /* pInvertRgn */
|
||||
NULL, /* pLineTo */
|
||||
NULL, /* pModifyWorldTransform */
|
||||
MFDRV_MoveTo, /* pMoveTo */
|
||||
NULL, /* pMoveTo */
|
||||
MFDRV_OffsetClipRgn, /* pOffsetClipRgn */
|
||||
MFDRV_OffsetViewportOrgEx, /* pOffsetViewportOrgEx */
|
||||
MFDRV_OffsetWindowOrgEx, /* pOffsetWindowOrgEx */
|
||||
|
|
|
@ -84,7 +84,6 @@ extern BOOL CDECL MFDRV_FlattenPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
|
|||
extern BOOL CDECL MFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT x, INT y ) DECLSPEC_HIDDEN;
|
||||
extern INT CDECL MFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
|
||||
extern BOOL CDECL MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN;
|
||||
extern BOOL CDECL MFDRV_MoveTo( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN;
|
||||
extern INT CDECL MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN;
|
||||
extern BOOL CDECL MFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
|
||||
extern BOOL CDECL MFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -3302,16 +3302,12 @@ static void test_mf_Graphics(void)
|
|||
ok( ret, "MoveToEx error %d.\n", GetLastError());
|
||||
ret = LineTo(hdcMetafile, 2, 2);
|
||||
ok( ret, "LineTo error %d.\n", GetLastError());
|
||||
|
||||
oldpoint.x = oldpoint.y = 0xdeadbeef;
|
||||
ret = MoveToEx(hdcMetafile, 1, 1, &oldpoint);
|
||||
ok( ret, "MoveToEx error %d.\n", GetLastError());
|
||||
|
||||
/* oldpoint gets garbage under Win XP, so the following test would
|
||||
* work under Wine but fails under Windows:
|
||||
*
|
||||
* ok((oldpoint.x == 2) && (oldpoint.y == 2),
|
||||
* "MoveToEx: (x, y) = (%ld, %ld), should be (2, 2).\n",
|
||||
* oldpoint.x, oldpoint.y);
|
||||
*/
|
||||
ok(oldpoint.x == 0xdeadbeef && oldpoint.y == 0xdeadbeef,
|
||||
"MoveToEx modified oldpoint\n");
|
||||
|
||||
ret = Ellipse(hdcMetafile, 0, 0, 2, 2);
|
||||
ok( ret, "Ellipse error %d.\n", GetLastError());
|
||||
|
|
Loading…
Reference in New Issue