Applying this patch, recompiling, and running on linux with the
MONO_XSYNC environment variable set will (along with slowing down
rendering immensely) flash the regions on the screen that a control will
be repainting.

It's useful in some cases to see where we're repainting more than we
should be (the datagrid is a good example), and cases where we're just
repainting everything too much (the toolbar is a good example).

Chris
Index: System.Windows.Forms/Control.cs
===================================================================
--- System.Windows.Forms/Control.cs	(revision 62842)
+++ System.Windows.Forms/Control.cs	(working copy)
@@ -1,3 +1,4 @@
+//#define DEBUG_INVALIDATE
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // "Software"), to deal in the Software without restriction, including
@@ -3829,6 +3830,16 @@
 						return;
 					}
 
+					for (int i = 0; i < 3; i ++) {
+						paint_event.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (Color.Red),
+										    paint_event.ClipRectangle);
+						Thread.Sleep (10);
+						paint_event.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (Color.White),
+										    paint_event.ClipRectangle);
+						Thread.Sleep (10);
+					}
+
+
 					if (!needs_redraw) {
 						// Just blit the previous image
 						paint_event.Graphics.DrawImage (ImageBuffer, paint_event.ClipRectangle, paint_event.ClipRectangle, GraphicsUnit.Pixel);
_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to