Commit 617cab35 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use NtGdiSelectClipPath for SelectClipPath.

parent 6ce4ad23
......@@ -386,24 +386,14 @@ BOOL CDECL EMFDRV_FlattenPath( PHYSDEV dev )
return EMFDRV_WriteRecord( dev, &emr.emr );
}
BOOL CDECL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode )
BOOL EMFDC_SelectClipPath( DC_ATTR *dc_attr, INT mode )
{
EMRSELECTCLIPPATH emr;
BOOL ret = FALSE;
HRGN hrgn;
emr.emr.iType = EMR_SELECTCLIPPATH;
emr.emr.nSize = sizeof(emr);
emr.iMode = iMode;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
hrgn = PathToRegion( dev->hdc );
if (hrgn)
{
ret = NtGdiExtSelectClipRgn( dev->hdc, hrgn, iMode );
DeleteObject( hrgn );
}
return ret;
emr.iMode = mode;
return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
}
BOOL CDECL EMFDRV_WidenPath( PHYSDEV dev )
......
......@@ -93,7 +93,6 @@ extern BOOL CDECL EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT righ
extern BOOL CDECL EMFDRV_ScaleWindowExtEx( PHYSDEV dev, INT xNum, INT xDenom,
INT yNum, INT yDenom, SIZE *size ) DECLSPEC_HIDDEN;
extern HBITMAP CDECL EMFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode ) DECLSPEC_HIDDEN;
extern HFONT CDECL EMFDRV_SelectFont( PHYSDEV dev, HFONT handle, UINT *aa_flags ) DECLSPEC_HIDDEN;
extern COLORREF CDECL EMFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF CDECL EMFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
......
......@@ -111,7 +111,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
EMFDRV_RoundRect, /* pRoundRect */
EMFDRV_SelectBitmap, /* pSelectBitmap */
NULL, /* pSelectBrush */
EMFDRV_SelectClipPath, /* pSelectClipPath */
NULL, /* pSelectClipPath */
EMFDRV_SelectFont, /* pSelectFont */
NULL, /* pSelectPen */
NULL, /* pSetBkColor */
......
......@@ -184,6 +184,7 @@ extern BOOL EMFDC_ScaleViewportExtEx( DC_ATTR *dc_attr, INT x_num, INT x_denom,
INT y_denom ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ScaleWindowExtEx( DC_ATTR *dc_attr, INT x_num, INT x_denom, INT y_num,
INT y_denom ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SelectClipPath( DC_ATTR *dc_attr, INT mode ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SelectObject( DC_ATTR *dc_attr, HGDIOBJ obj ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SelectPalette( DC_ATTR *dc_attr, HPALETTE palette ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetArcDirection( DC_ATTR *dc_attr, INT dir ) DECLSPEC_HIDDEN;
......
......@@ -1532,6 +1532,18 @@ BOOL WINAPI FillPath( HDC hdc )
}
/***********************************************************************
* SelectClipPath (GDI32.@)
*/
BOOL WINAPI SelectClipPath( HDC hdc, INT mode )
{
DC_ATTR *dc_attr;
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
if (dc_attr->emf && !EMFDC_SelectClipPath( dc_attr, mode )) return FALSE;
return NtGdiSelectClipPath( hdc, mode );
}
/***********************************************************************
* IntersectClipRect (GDI32.@)
*/
INT WINAPI IntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bottom )
......
......@@ -714,18 +714,17 @@ BOOL WINAPI NtGdiFillPath( HDC hdc )
/***********************************************************************
* SelectClipPath (GDI32.@)
* NtGdiSelectClipPath (win32u.@)
*/
BOOL WINAPI SelectClipPath(HDC hdc, INT iMode)
BOOL WINAPI NtGdiSelectClipPath( HDC hdc, INT mode )
{
BOOL ret = FALSE;
DC *dc = get_dc_ptr( hdc );
HRGN rgn;
if (dc)
if ((rgn = PathToRegion( hdc )))
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSelectClipPath );
ret = physdev->funcs->pSelectClipPath( physdev, iMode );
release_dc_ptr( dc );
ret = NtGdiExtSelectClipRgn( hdc, rgn, mode ) != ERROR;
DeleteObject( rgn );
}
return ret;
}
......@@ -2005,15 +2004,7 @@ BOOL CDECL nulldrv_CloseFigure( PHYSDEV dev )
BOOL CDECL nulldrv_SelectClipPath( PHYSDEV dev, INT mode )
{
BOOL ret = FALSE;
HRGN hrgn = PathToRegion( dev->hdc );
if (hrgn)
{
ret = ExtSelectClipRgn( dev->hdc, hrgn, mode ) != ERROR;
DeleteObject( hrgn );
}
return ret;
return TRUE;
}
BOOL CDECL nulldrv_FillPath( PHYSDEV dev )
......
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