gdi32: Use NtGdiExcludeClipRect for ExcludeClipRect 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:
parent
112fe018bf
commit
92e7cc1e03
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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.@)
|
||||
*/
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue