[Mono-bugs] [Bug 82530][Wis] Changed - Unrequired updates when loading XAML files

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Aug 27 09:51:00 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by sebastien at ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=82530

--- shadow/82530	2007-08-22 12:47:35.000000000 -0400
+++ shadow/82530.tmp.21888	2007-08-27 09:51:00.000000000 -0400
@@ -68,6 +68,31 @@
 FrameworkElement::WidthProperty resets cache
 FrameworkElement::HeightProperty sets cache
 
 So for rectangles we compute three times instead of one (or zero,
 since ideally the path doesn't really need to be computed at xaml load
 time).
+
+------- Additional Comments From sebastien at ximian.com  2007-08-27 09:51 -------
+using a simple, crude and potentially bad (it may mess with other
+stuff) hack I can avoid 154 rectangles cairo path being "built" when
+starting monotone.
+
+void
+Shape::OnLoaded ()
+{
+       // based on path-caching (won't really work on SVN right now)
+       if (!path) {
+               Invalidate ();
+       }
+       FrameworkElement::OnLoaded ();
+}
+
+Rectangle::Draw (cairo_t *cr)
+{
+       if (!IsLoaded ()) {
+g_warning ("avoided building Rectangle path");
+               return;
+       }
+
+This hack, if working, would be useful when both loading XAML and
+under "normal" (code) circumstances.


More information about the mono-bugs mailing list