Improved redraw performance when application loaded

Dave Hawkes daveh-wine at cadlink.com
Thu Dec 13 15:44:29 CST 2001


changelog:

Reduced the time for a window with many child windows to be displayed.


More info:

A large application was taking up to 10 seconds to display its main
window.
This appears to be due to X individually exposing every child window (of
which there are very many) of the main application window and then wine
forcing a redraw on the parent of every child and then all the
subchildren
again (!) resulting in the accumulation of a huge redraw list. This
patch
will force a redraw only on the child and not the parent as X will
eventually expose that anyway. After applying this patch the initial
redraw
dropped from around 10 seconds to about 2 seconds and I could not find
any
painting problems

If anyone else is having slow application loading problems of this
nature,
then please try this patch.

Dave Hawkes

-------------- next part --------------
Index: dlls/x11drv/winpos.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/winpos.c,v
retrieving revision 1.34
diff -u -r1.34 winpos.c
--- dlls/x11drv/winpos.c	2001/11/13 22:02:20	1.34
+++ dlls/x11drv/winpos.c	2001/12/13 19:40:01
@@ -233,7 +233,7 @@
  *
  * Expose a region of a given window.
  */
-static void expose_window( HWND hwnd, RECT *rect, HRGN rgn, int flags )
+static void expose_window( HWND hwnd, RECT *rect, HRGN rgn, int flags, int noparents )
 {
     POINT offset;
     HWND top = 0;
@@ -242,7 +242,7 @@
 
     /* find the top most parent that doesn't clip children or siblings and
      * invalidate the area on its parent, including all children */
-    if ((list = WIN_ListParents( hwnd )))
+    if (!noparents && (list = WIN_ListParents( hwnd )))
     {
         HWND current = hwnd;
         LONG style = GetWindowLongW( hwnd, GWL_STYLE );
@@ -269,7 +269,6 @@
         }
         HeapFree( GetProcessHeap(), 0, list );
     }
-
     if (!top) top = hwnd;
 
     /* make coords relative to top */
@@ -311,7 +310,7 @@
     if (ret != NULLREGION)
     {
         if (get_covered_region( win, hrgn ) != NULLREGION)
-            expose_window( win->parent, NULL, hrgn, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN );
+            expose_window( win->parent, NULL, hrgn, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN, 0 );
     }
     DeleteObject( hrgn );
 }
@@ -360,7 +359,7 @@
     {
         if (get_covered_region( win, hrgn ) != NULLREGION)
             expose_window( win->hwndSelf, NULL, hrgn,
-                           RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_ALLCHILDREN );
+                           RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_ALLCHILDREN, 0 );
     }
 
     DeleteObject( hrgn );
@@ -396,7 +395,7 @@
     }
     WIN_ReleasePtr( win );
 
-    expose_window( hwnd, &rect, 0, flags );
+    expose_window( hwnd, &rect, 0, flags, 1 );
 }
 
 


More information about the wine-patches mailing list