gdi32: Use NtGdiCloseFigure for CloseFigure 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-23 10:50:13 +02:00 committed by Alexandre Julliard
parent cc7e7002ef
commit 0f3173e7d9
6 changed files with 20 additions and 23 deletions

View File

@ -513,15 +513,14 @@ BOOL CDECL EMFDRV_BeginPath( PHYSDEV dev )
return TRUE;
}
BOOL CDECL EMFDRV_CloseFigure( PHYSDEV dev )
BOOL EMFDC_CloseFigure( DC_ATTR *dc_attr )
{
EMRCLOSEFIGURE emr;
emr.emr.iType = EMR_CLOSEFIGURE;
emr.emr.nSize = sizeof(emr);
EMFDRV_WriteRecord( dev, &emr.emr );
return FALSE; /* always fails without a path */
return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
}
BOOL CDECL EMFDRV_EndPath( PHYSDEV dev )
@ -611,18 +610,6 @@ static BOOL CDECL emfpathdrv_BeginPath( PHYSDEV dev )
return (emfdev->funcs->pBeginPath( emfdev ) && next->funcs->pBeginPath( next ));
}
/***********************************************************************
* emfpathdrv_CloseFigure
*/
static BOOL CDECL emfpathdrv_CloseFigure( PHYSDEV dev )
{
PHYSDEV emfdev = get_emfdev( dev );
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pCloseFigure );
emfdev->funcs->pCloseFigure( emfdev );
return next->funcs->pCloseFigure( next );
}
/***********************************************************************
* emfpathdrv_CreateDC
*/
@ -670,7 +657,7 @@ static const struct gdi_dc_funcs emfpath_driver =
emfpathdrv_BeginPath, /* pBeginPath */
NULL, /* pBlendImage */
NULL, /* pChord */
emfpathdrv_CloseFigure, /* pCloseFigure */
NULL, /* pCloseFigure */
NULL, /* pCreateCompatibleDC */
emfpathdrv_CreateDC, /* pCreateDC */
emfpathdrv_DeleteDC, /* pDeleteDC */

View File

@ -71,7 +71,6 @@ extern BOOL CDECL EMFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT wid
PHYSDEV devSrc, INT xSrc, INT ySrc, DWORD rop ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_CloseFigure( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_EndPath( PHYSDEV dev ) DECLSPEC_HIDDEN;

View File

@ -44,8 +44,8 @@ static const struct gdi_dc_funcs emfdrv_driver =
EMFDRV_ArcTo, /* pArcTo */
EMFDRV_BeginPath, /* pBeginPath */
NULL, /* pBlendImage */
EMFDRV_Chord, /* pChord */
EMFDRV_CloseFigure, /* pCloseFigure */
NULL, /* pChord */
NULL, /* pCloseFigure */
NULL, /* pCreateCompatibleDC */
NULL, /* pCreateDC */
EMFDRV_DeleteDC, /* pDeleteDC */

View File

@ -67,6 +67,7 @@ extern BOOL EMFDC_AngleArc( DC_ATTR *dc_attr, INT x, INT y, DWORD radius, FLOAT
extern BOOL EMFDC_ArcChordPie( DC_ATTR *dc_attr, INT left, INT top, INT right,
INT bottom, INT xstart, INT ystart, INT xend,
INT yend, DWORD type ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_CloseFigure( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_Ellipse( DC_ATTR *dc_attr, INT left, INT top, INT right,
INT bottom ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ExtTextOut( DC_ATTR *dc_attr, INT x, INT y, UINT flags, const RECT *rect,

View File

@ -375,3 +375,15 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *rect,
return FALSE;
return NtGdiExtTextOutW( hdc, x, y, flags, rect, str, count, dx, 0 );
}
/***********************************************************************
* CloseFigure (GDI32.@)
*/
BOOL WINAPI CloseFigure( HDC hdc )
{
DC_ATTR *dc_attr;
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
if (dc_attr->emf && !EMFDC_CloseFigure( dc_attr )) return FALSE;
return NtGdiCloseFigure( hdc );
}

View File

@ -617,11 +617,9 @@ BOOL WINAPI AbortPath( HDC hdc )
/***********************************************************************
* CloseFigure (GDI32.@)
*
* FIXME: Check that SetLastError is being called correctly
* NtGdiCloseFigure (win32u.@)
*/
BOOL WINAPI CloseFigure(HDC hdc)
BOOL WINAPI NtGdiCloseFigure( HDC hdc )
{
BOOL ret = FALSE;
DC *dc = get_dc_ptr( hdc );