diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c index a942fe19cf8..e8656564525 100644 --- a/dlls/gdi32/clipping.c +++ b/dlls/gdi32/clipping.c @@ -156,26 +156,24 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode ) } /*********************************************************************** - * SelectVisRgn (GDI32.@) - * - * Note: not exported on Windows, only the 16-bit version is exported. + * __wine_set_visible_region (GDI32.@) */ -INT WINAPI SelectVisRgn( HDC hdc, HRGN hrgn ) +void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect ) { - int retval; DC * dc; - if (!hrgn) return ERROR; - if (!(dc = get_dc_ptr( hdc ))) return ERROR; + if (!(dc = get_dc_ptr( hdc ))) return; - TRACE("%p %p\n", hdc, hrgn ); + TRACE( "%p %p %s\n", hdc, hrgn, wine_dbgstr_rect(vis_rect) ); + /* map region to DC coordinates */ + OffsetRgn( hrgn, -vis_rect->left, -vis_rect->top ); + + DeleteObject( dc->hVisRgn ); dc->dirty = 0; - - retval = CombineRgn( dc->hVisRgn, hrgn, 0, RGN_COPY ); + dc->hVisRgn = hrgn; CLIPPING_UpdateGCRegion( dc ); release_dc_ptr( dc ); - return retval; } diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index d3843e6788a..f66e7d5e805 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -514,7 +514,6 @@ # Wine extensions: Win16 functions that are needed by other dlls # @ stdcall GetDCHook(long ptr) -@ stdcall SelectVisRgn(long long) @ stdcall SetDCHook(long ptr long) @ stdcall SetHookFlags(long long) @@ -526,3 +525,4 @@ # GDI objects @ cdecl __wine_make_gdi_object_system(long long) +@ cdecl __wine_set_visible_region(long long ptr) diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c index cd096cda90b..969c63eb698 100644 --- a/dlls/user32/painting.c +++ b/dlls/user32/painting.c @@ -160,10 +160,7 @@ 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 ); - /* map region to DC coordinates */ - OffsetRgn( vis_rgn, -win_rect.left, -win_rect.top ); - SelectVisRgn( dce->hdc, vis_rgn ); - DeleteObject( vis_rgn ); + __wine_set_visible_region( dce->hdc, vis_rgn, &win_rect ); } diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 3d4075fa2da..8c6367e2471 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -384,8 +384,6 @@ static const WORD wPattern55AA[] = { 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xa HBRUSH SYSCOLOR_55AABrush = 0; -extern void CDECL __wine_make_gdi_object_system( HGDIOBJ handle, BOOL set ); - static void SYSPARAMS_LogFont16To32W( const LOGFONT16 *font16, LPLOGFONTW font32 ) { diff --git a/include/wingdi.h b/include/wingdi.h index 53db856e65b..3f5058fdfbc 100644 --- a/include/wingdi.h +++ b/include/wingdi.h @@ -3790,7 +3790,10 @@ typedef BOOL (CALLBACK *DCHOOKPROC)(HDC,WORD,DWORD_PTR,LPARAM); WINGDIAPI DWORD_PTR WINAPI GetDCHook(HDC,DCHOOKPROC*); WINGDIAPI BOOL WINAPI SetDCHook(HDC,DCHOOKPROC,DWORD_PTR); WINGDIAPI WORD WINAPI SetHookFlags(HDC,WORD); -WINGDIAPI INT WINAPI SelectVisRgn(HDC,HRGN); + +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 ); + #endif /* __WINESRC__ */ #ifdef __cplusplus