gdi32: Let user32 specify the device rectangle when setting the visible region.

This commit is contained in:
Alexandre Julliard 2012-09-05 19:29:29 +02:00
parent 75b641fc75
commit 01c9c1cbc2
4 changed files with 10 additions and 7 deletions

View File

@ -268,13 +268,13 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode )
/***********************************************************************
* __wine_set_visible_region (GDI32.@)
*/
void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect )
void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect, const RECT *device_rect )
{
DC * dc;
if (!(dc = get_dc_ptr( hdc ))) return;
TRACE( "%p %p %s\n", hdc, hrgn, wine_dbgstr_rect(vis_rect) );
TRACE( "%p %p %s %s\n", hdc, hrgn, wine_dbgstr_rect(vis_rect), wine_dbgstr_rect(device_rect) );
/* map region to DC coordinates */
OffsetRgn( hrgn, -vis_rect->left, -vis_rect->top );
@ -282,6 +282,7 @@ void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect )
if (dc->hVisRgn) DeleteObject( dc->hVisRgn );
dc->dirty = 0;
dc->vis_rect = *vis_rect;
dc->device_rect = *device_rect;
dc->hVisRgn = hrgn;
DC_UpdateXforms( dc );
update_dc_clipping( dc );
@ -415,8 +416,6 @@ INT WINAPI GetClipBox( HDC hdc, LPRECT rect )
if (get_dc_region( dc ))
{
ret = GetRgnBox( get_dc_region( dc ), rect );
if (get_dc_device_rect( dc, &visrect ) && !intersect_rect( rect, rect, &visrect ))
ret = NULLREGION;
}
else
{
@ -424,6 +423,8 @@ INT WINAPI GetClipBox( HDC hdc, LPRECT rect )
*rect = dc->vis_rect;
}
if (get_dc_device_rect( dc, &visrect ) && !intersect_rect( rect, rect, &visrect )) ret = NULLREGION;
if (dc->layout & LAYOUT_RTL)
{
int tmp = rect->left;

View File

@ -511,7 +511,7 @@
# GDI objects
@ cdecl __wine_make_gdi_object_system(long long)
@ cdecl __wine_set_visible_region(long long ptr)
@ cdecl __wine_set_visible_region(long long ptr ptr)
# OpenGL
@ cdecl __wine_get_wgl_driver(long long)

View File

@ -161,7 +161,8 @@ static void update_visible_region( struct dce *dce )
if (dce->clip_rgn) CombineRgn( vis_rgn, vis_rgn, dce->clip_rgn,
(flags & DCX_INTERSECTRGN) ? RGN_AND : RGN_DIFF );
__wine_set_visible_region( dce->hdc, vis_rgn, &win_rect );
top_rect = get_virtual_screen_rect();
__wine_set_visible_region( dce->hdc, vis_rgn, &win_rect, &top_rect );
}

View File

@ -236,7 +236,8 @@ WINGDIAPI BOOL WINAPI SetDCHook(HDC,DCHOOKPROC,DWORD_PTR);
WINGDIAPI WORD WINAPI SetHookFlags(HDC,WORD);
extern void CDECL __wine_make_gdi_object_system( HGDIOBJ handle, BOOL set );
extern void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect );
extern void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect,
const RECT *device_rect );
extern struct opengl_funcs * CDECL __wine_get_wgl_driver( HDC hdc, UINT version );
#endif /* __WINE_WINE_GDI_DRIVER_H */