gdi32: Handle metafiles directly in Arc 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:
Jacek Caban 2021-07-18 12:57:34 +02:00 committed by Alexandre Julliard
parent b70616b508
commit b789992337
6 changed files with 29 additions and 9 deletions

View file

@ -37,6 +37,8 @@ static inline BOOL is_meta_dc( HDC hdc )
return (handle & NTGDI_HANDLE_TYPE_MASK) >> NTGDI_HANDLE_TYPE_SHIFT == NTGDI_OBJ_METADC;
}
extern BOOL METADC_Arc( HDC hdc, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL METADC_Chord( HDC hdc, INT left, INT top, INT right, INT bottom, INT xstart,
INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL METADC_LineTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;

View file

@ -55,6 +55,11 @@ BOOL WINAPI Arc( HDC hdc, INT left, INT top, INT right, INT bottom,
{
TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc, left, top,
right, bottom, xstart, ystart, xend, yend );
if (is_meta_dc( hdc ))
return METADC_Arc( hdc, left, top, right, bottom,
xstart, ystart, xend, yend );
return NtGdiArcInternal( NtGdiArc, hdc, left, top, right, bottom,
xstart, ystart, xend, yend );
}

View file

@ -48,13 +48,23 @@ BOOL METADC_LineTo( HDC hdc, INT x, INT y )
/***********************************************************************
* MFDRV_Arc
* METADC_Arc
*/
BOOL CDECL MFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
BOOL METADC_Arc( HDC hdc, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
return MFDRV_MetaParam8(dev, META_ARC, left, top, right, bottom,
xstart, ystart, xend, yend);
return metadc_param8( hdc, META_ARC, left, top, right, bottom,
xstart, ystart, xend, yend );
}
/***********************************************************************
* MFDRV_ArcTo
*/
BOOL CDECL MFDRV_ArcTo( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
return FALSE;
}

View file

@ -103,8 +103,8 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
MFDRV_AbortPath, /* pAbortPath */
NULL, /* pAlphaBlend */
NULL, /* pAngleArc */
MFDRV_Arc, /* pArc */
NULL, /* pArcTo */
NULL, /* pArc */
MFDRV_ArcTo, /* pArcTo */
MFDRV_BeginPath, /* pBeginPath */
NULL, /* pBlendImage */
NULL, /* pChord */

View file

@ -67,8 +67,8 @@ extern BOOL metadc_param8( HDC hdc, short func, short param1, short param2,
/* Metafile driver functions */
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_ArcTo( 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_CloseFigure( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN;

View file

@ -3312,6 +3312,9 @@ static void test_mf_Graphics(void)
ret = Ellipse(hdcMetafile, 0, 0, 2, 2);
ok( ret, "Ellipse error %d.\n", GetLastError());
ret = ArcTo(hdcMetafile, 1, 2, 30, 40, 11, 12, 23, 24 );
ok( !ret, "ArcTo succeeded\n" );
hMetafile = CloseMetaFile(hdcMetafile);
ok(hMetafile != 0, "CloseMetaFile error %d\n", GetLastError());
type = GetObjectType(hdcMetafile);