diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c index 9e03635a103..bea2c7f8cfc 100644 --- a/dlls/gdi32/clipping.c +++ b/dlls/gdi32/clipping.c @@ -191,17 +191,7 @@ INT CDECL nulldrv_ExtSelectClipRgn( PHYSDEV dev, HRGN rgn, INT mode ) INT CDECL nulldrv_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) { - DC *dc = get_nulldrv_dc( dev ); - RECT rect = get_clip_rect( dc, left, top, right, bottom ); - INT ret; - HRGN rgn; - - if (!(rgn = CreateRectRgnIndirect( &rect ))) return ERROR; - if (!dc->hClipRgn) create_default_clip_region( dc ); - ret = NtGdiCombineRgn( dc->hClipRgn, dc->hClipRgn, rgn, RGN_DIFF ); - DeleteObject( rgn ); - if (ret != ERROR) update_dc_clipping( dc ); - return ret; + return ERROR; } INT CDECL nulldrv_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) @@ -296,21 +286,29 @@ INT WINAPI NtGdiOffsetClipRgn( HDC hdc, INT x, INT y ) /*********************************************************************** - * ExcludeClipRect (GDI32.@) + * NtGdiExcludeClipRect (win32u.@) */ -INT WINAPI ExcludeClipRect( HDC hdc, INT left, INT top, - INT right, INT bottom ) +INT WINAPI NtGdiExcludeClipRect( HDC hdc, INT left, INT top, INT right, INT bottom ) { - PHYSDEV physdev; - INT ret; + INT ret = ERROR; + RECT rect; + HRGN rgn; DC *dc = get_dc_ptr( hdc ); TRACE("%p %d,%d-%d,%d\n", hdc, left, top, right, bottom ); if (!dc) return ERROR; update_dc( dc ); - physdev = GET_DC_PHYSDEV( dc, pExcludeClipRect ); - ret = physdev->funcs->pExcludeClipRect( physdev, left, top, right, bottom ); + + rect = get_clip_rect( dc, left, top, right, bottom ); + + if ((rgn = CreateRectRgnIndirect( &rect ))) + { + if (!dc->hClipRgn) create_default_clip_region( dc ); + ret = NtGdiCombineRgn( dc->hClipRgn, dc->hClipRgn, rgn, RGN_DIFF ); + DeleteObject( rgn ); + if (ret != ERROR) update_dc_clipping( dc ); + } release_dc_ptr( dc ); return ret; } diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c index 4b51a140c27..8508f6296be 100644 --- a/dlls/gdi32/enhmfdrv/dc.c +++ b/dlls/gdi32/enhmfdrv/dc.c @@ -146,9 +146,8 @@ BOOL EMFDC_SetArcDirection( DC_ATTR *dc_attr, INT dir ) return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr ); } -INT CDECL EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) +INT EMFDC_ExcludeClipRect( DC_ATTR *dc_attr, INT left, INT top, INT right, INT bottom ) { - PHYSDEV next = GET_NEXT_PHYSDEV( dev, pExcludeClipRect ); EMREXCLUDECLIPRECT emr; emr.emr.iType = EMR_EXCLUDECLIPRECT; @@ -157,8 +156,7 @@ INT CDECL EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT emr.rclClip.top = top; emr.rclClip.right = right; emr.rclClip.bottom = bottom; - if (!EMFDRV_WriteRecord( dev, &emr.emr )) return ERROR; - return next->funcs->pExcludeClipRect( next, left, top, right, bottom ); + return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr ); } BOOL EMFDC_IntersectClipRect( DC_ATTR *dc_attr, INT left, INT top, INT right, INT bottom) diff --git a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h index d0d7ad14878..08936a73f8f 100644 --- a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h +++ b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h @@ -70,7 +70,6 @@ extern BOOL CDECL EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, I INT xstart, INT ystart, INT xend, INT yend ) 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 INT CDECL EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN; extern INT CDECL EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR str, UINT count, const INT *lpDx ) DECLSPEC_HIDDEN; diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index 80326fe0d04..17179dd37ba 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -57,7 +57,7 @@ static const struct gdi_dc_funcs emfdrv_driver = NULL, /* pEndPath */ NULL, /* pEnumFonts */ NULL, /* pEnumICMProfiles */ - EMFDRV_ExcludeClipRect, /* pExcludeClipRect */ + NULL, /* pExcludeClipRect */ NULL, /* pExtDeviceMode */ NULL, /* pExtEscape */ NULL, /* pExtFloodFill */ diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 58ea438a582..b0136e9c898 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -47,6 +47,8 @@ extern BOOL METADC_Arc( HDC hdc, INT left, INT top, INT right, INT bottom, 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_Ellipse( HDC hdc, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN; +extern BOOL METADC_ExcludeClipRect( HDC hdc, INT left, INT top, INT right, + INT bottom ) DECLSPEC_HIDDEN; extern BOOL METADC_ExtFloodFill( HDC hdc, INT x, INT y, COLORREF color, UINT fill_type ) DECLSPEC_HIDDEN; extern BOOL METADC_ExtTextOut( HDC hdc, INT x, INT y, UINT flags, const RECT *rect, @@ -92,6 +94,8 @@ 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_EndPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN; +extern BOOL EMFDC_ExcludeClipRect( DC_ATTR *dc_attr, INT left, INT top, INT right, + INT bottom ) DECLSPEC_HIDDEN; extern BOOL EMFDC_ExtFloodFill( DC_ATTR *dc_attr, INT x, INT y, COLORREF color, UINT fill_type ) DECLSPEC_HIDDEN; extern BOOL EMFDC_ExtTextOut( DC_ATTR *dc_attr, INT x, INT y, UINT flags, const RECT *rect, diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index c1743498934..716b5ee28a5 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -1075,6 +1075,20 @@ INT WINAPI OffsetClipRgn( HDC hdc, INT x, INT y ) return NtGdiOffsetClipRgn( hdc, x, y ); } +/*********************************************************************** + * ExcludeClipRect (GDI32.@) + */ +INT WINAPI ExcludeClipRect( HDC hdc, INT left, INT top, INT right, INT bottom ) +{ + DC_ATTR *dc_attr; + + if (is_meta_dc( hdc )) return METADC_ExcludeClipRect( hdc, left, top, right, bottom ); + if (!(dc_attr = get_dc_attr( hdc ))) return FALSE; + if (dc_attr->emf && !EMFDC_ExcludeClipRect( dc_attr, left, top, right, bottom )) + return FALSE; + return NtGdiExcludeClipRect( hdc, left, top, right, bottom ); +} + /*********************************************************************** * GdiSetPixelFormat (GDI32.@) */ diff --git a/dlls/gdi32/mfdrv/dc.c b/dlls/gdi32/mfdrv/dc.c index fde7bacfd11..363274a40b0 100644 --- a/dlls/gdi32/mfdrv/dc.c +++ b/dlls/gdi32/mfdrv/dc.c @@ -75,9 +75,9 @@ BOOL METADC_IntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bottom return metadc_param4( hdc, META_INTERSECTCLIPRECT, left, top, right, bottom ); } -INT CDECL MFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) +BOOL METADC_ExcludeClipRect( HDC hdc, INT left, INT top, INT right, INT bottom ) { - return MFDRV_MetaParam4( dev, META_EXCLUDECLIPRECT, left, top, right, bottom ); + return metadc_param4( hdc, META_EXCLUDECLIPRECT, left, top, right, bottom ); } BOOL METADC_OffsetClipRgn( HDC hdc, INT x, INT y ) diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index 01e1ee92c98..db508ea3dbd 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -122,7 +122,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs = MFDRV_EndPath, /* pEndPath */ NULL, /* pEnumFonts */ NULL, /* pEnumICMProfiles */ - MFDRV_ExcludeClipRect, /* pExcludeClipRect */ + NULL, /* pExcludeClipRect */ NULL, /* pExtDeviceMode */ MFDRV_ExtEscape, /* pExtEscape */ NULL, /* pExtFloodFill */ diff --git a/dlls/gdi32/mfdrv/metafiledrv.h b/dlls/gdi32/mfdrv/metafiledrv.h index 5b5d17859fa..17fd626c5ec 100644 --- a/dlls/gdi32/mfdrv/metafiledrv.h +++ b/dlls/gdi32/mfdrv/metafiledrv.h @@ -83,7 +83,6 @@ 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; extern BOOL CDECL MFDRV_EndPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern INT CDECL MFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN; extern INT CDECL MFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN;