diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c index f424b459fb3..bf8f1a85ad9 100644 --- a/dlls/gdi32/enhmfdrv/dc.c +++ b/dlls/gdi32/enhmfdrv/dc.c @@ -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 ) diff --git a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h index fb108c15be5..ea60aa6cf29 100644 --- a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h +++ b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h @@ -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; diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index 5421f6009ce..57d538f3597 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -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 */ diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 0a894e9ec3d..1e0e4d2dd0a 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -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; diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index 85744cc5c11..067a7e7f588 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -1531,6 +1531,18 @@ BOOL WINAPI FillPath( HDC hdc ) return NtGdiFillPath( 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.@) */ diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index 54e93ca74db..2badf2874f2 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -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 )