Commit b39d4cbe authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use NtGdiFlattenPath for FlattenPath.

parent 617cab35
......@@ -376,14 +376,13 @@ BOOL EMFDC_EndPath( DC_ATTR *dc_attr )
return EMFDRV_WriteRecord( &emf->dev, &emr.emr );
}
BOOL CDECL EMFDRV_FlattenPath( PHYSDEV dev )
BOOL EMFDC_FlattenPath( DC_ATTR *dc_attr )
{
EMRFLATTENPATH emr;
emr.emr.iType = EMR_FLATTENPATH;
emr.emr.nSize = sizeof(emr);
return EMFDRV_WriteRecord( dev, &emr.emr );
return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
}
BOOL EMFDC_SelectClipPath( DC_ATTR *dc_attr, INT mode )
......
......@@ -71,7 +71,6 @@ extern BOOL CDECL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
UINT count, const INT *lpDx ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_FlattenPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width, INT height ) DECLSPEC_HIDDEN;
extern INT CDECL EMFDRV_GetDeviceCaps( PHYSDEV dev, INT cap ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
......
......@@ -63,7 +63,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
EMFDRV_ExtTextOut, /* pExtTextOut */
EMFDRV_FillPath, /* pFillPath */
EMFDRV_FillRgn, /* pFillRgn */
EMFDRV_FlattenPath, /* pFlattenPath */
NULL, /* pFlattenPath */
NULL, /* pFontIsLinked */
EMFDRV_FrameRgn, /* pFrameRgn */
NULL, /* pGetBoundsRect */
......
......@@ -149,6 +149,7 @@ extern BOOL EMFDC_ExtTextOut( DC_ATTR *dc_attr, INT x, INT y, UINT flags, const
const WCHAR *str, UINT count, const INT *dx ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_FillPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_FillRgn( DC_ATTR *dc_attr, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_FlattenPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_FrameRgn( DC_ATTR *dc_attr, HRGN hrgn, HBRUSH hbrush, INT width,
INT height ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_GradientFill( DC_ATTR *dc_attr, TRIVERTEX *vert_array, ULONG nvert,
......
......@@ -1532,6 +1532,18 @@ BOOL WINAPI FillPath( HDC hdc )
}
/***********************************************************************
* FlattenPath (GDI32.@)
*/
BOOL WINAPI FlattenPath( HDC hdc )
{
DC_ATTR *dc_attr;
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
if (dc_attr->emf && !EMFDC_FlattenPath( dc_attr )) return FALSE;
return NtGdiFlattenPath( hdc );
}
/***********************************************************************
* SelectClipPath (GDI32.@)
*/
BOOL WINAPI SelectClipPath( HDC hdc, INT mode )
......
......@@ -1588,21 +1588,25 @@ static BOOL CDECL pathdrv_CloseFigure( PHYSDEV dev )
/*******************************************************************
* FlattenPath [GDI32.@]
*
*
* NtGdiFlattenPath (win32u.@)
*/
BOOL WINAPI FlattenPath(HDC hdc)
BOOL WINAPI NtGdiFlattenPath( HDC hdc )
{
struct gdi_path *path;
BOOL ret = FALSE;
DC *dc = get_dc_ptr( hdc );
DC *dc;
if (dc)
if (!(dc = get_dc_ptr( hdc ))) return FALSE;
if (!dc->path) SetLastError( ERROR_CAN_NOT_COMPLETE );
else if ((path = PATH_FlattenPath( dc->path )))
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pFlattenPath );
ret = physdev->funcs->pFlattenPath( physdev );
release_dc_ptr( dc );
free_gdi_path( dc->path );
dc->path = path;
ret = TRUE;
}
release_dc_ptr( dc );
return ret;
}
......@@ -2030,17 +2034,6 @@ BOOL CDECL nulldrv_StrokePath( PHYSDEV dev )
BOOL CDECL nulldrv_FlattenPath( PHYSDEV dev )
{
DC *dc = get_nulldrv_dc( dev );
struct gdi_path *path;
if (!dc->path)
{
SetLastError( ERROR_CAN_NOT_COMPLETE );
return FALSE;
}
if (!(path = PATH_FlattenPath( dc->path ))) return FALSE;
free_gdi_path( dc->path );
dc->path = path;
return TRUE;
}
......
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