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

Alexandre Julliard julliard at winehq.org
Wed Sep 5 15:36:45 CDT 2012


Module: wine
Branch: master
Commit: 01c9c1cbc246ea7b4a8fdcd9773485404e3c2eca
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=01c9c1cbc246ea7b4a8fdcd9773485404e3c2eca

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Sep  5 19:29:29 2012 +0200

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

---

 dlls/gdi32/clipping.c     |    9 +++++----
 dlls/gdi32/gdi32.spec     |    2 +-
 dlls/user32/painting.c    |    3 ++-
 include/wine/gdi_driver.h |    3 ++-
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c
index 1cb420c..3486a18 100644
--- a/dlls/gdi32/clipping.c
+++ b/dlls/gdi32/clipping.c
@@ -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;
diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec
index 1e30485..dfb8732 100644
--- a/dlls/gdi32/gdi32.spec
+++ b/dlls/gdi32/gdi32.spec
@@ -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)
diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c
index 64f4318..d6b5aaf 100644
--- a/dlls/user32/painting.c
+++ b/dlls/user32/painting.c
@@ -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 );
 }
 
 
diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h
index 2f31628..6605c67 100644
--- a/include/wine/gdi_driver.h
+++ b/include/wine/gdi_driver.h
@@ -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 */




More information about the wine-cvs mailing list