Author: toshok
Date: 2007-11-20 16:36:02 -0500 (Tue, 20 Nov 2007)
New Revision: 90038

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/collection.cpp
   trunk/moon/src/dirty.cpp
   trunk/moon/src/uielement.cpp
   trunk/moon/src/uielement.h
Log:
2007-11-20  Chris Toshok  <[EMAIL PROTECTED]>

        * collection.cpp (VisualRemoved): switch from using
        item->parent->ChildInvalidated(UIElement), use
        item->parent->Invalidate (item->GetBounds()).

        * uielement.h, uielement.cpp: change ChildInvalidated(Region *) to
        Invalidate (Region*) and update calls to it.  Remove
        ChildInvalidated(UIElement*).  Also, remove all references to the
        children_dirty_region field.  everything goes through dirty_region
        now.

        * dirty.cpp: switch to using item->parent->Invalidate instead of
        item->parent->ChildInvalidated, and remove references to
        children_dirty_region.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-11-20 21:34:41 UTC (rev 90037)
+++ trunk/moon/src/ChangeLog    2007-11-20 21:36:02 UTC (rev 90038)
@@ -1,5 +1,21 @@
 2007-11-20  Chris Toshok  <[EMAIL PROTECTED]>
 
+       * collection.cpp (VisualRemoved): switch from using
+       item->parent->ChildInvalidated(UIElement), use
+       item->parent->Invalidate (item->GetBounds()).
+
+       * uielement.h, uielement.cpp: change ChildInvalidated(Region *) to
+       Invalidate (Region*) and update calls to it.  Remove
+       ChildInvalidated(UIElement*).  Also, remove all references to the
+       children_dirty_region field.  everything goes through dirty_region
+       now.
+
+       * dirty.cpp: switch to using item->parent->Invalidate instead of
+       item->parent->ChildInvalidated, and remove references to
+       children_dirty_region.
+
+2007-11-20  Chris Toshok  <[EMAIL PROTECTED]>
+
        * dependencyobject.cpp: add a ctor for EventClosure, and do a deep
        copy before emitting an event.
 

Modified: trunk/moon/src/collection.cpp
===================================================================
--- trunk/moon/src/collection.cpp       2007-11-20 21:34:41 UTC (rev 90037)
+++ trunk/moon/src/collection.cpp       2007-11-20 21:36:02 UTC (rev 90038)
@@ -461,14 +461,13 @@
        if (item->parent == NULL)
                return;
 
-       // we can't just call item->Invalidate() here, since
-       // dirty.cpp relies on the child->parent link being
-       // present.  Instead we directly call ChildInvalidated
-       // with the entire bounds of the child (which is
-       // likely suboptimal, considering panels without
-       // backgrounds might have a more optimized region we
-       // can redraw).
-       item->parent->ChildInvalidated (item);
+       // we can't just call item->Invalidate() here, since dirty.cpp
+       // relies on the child->parent link being present.  Instead we
+       // directly call item->parent->Invalidate with the entire
+       // bounds of the child (which is likely suboptimal,
+       // considering panels without backgrounds might have a more
+       // optimized region we can redraw).
+       item->parent->Invalidate (item->GetBounds());
        item->parent = NULL;
 }
 

Modified: trunk/moon/src/dirty.cpp
===================================================================
--- trunk/moon/src/dirty.cpp    2007-11-20 21:34:41 UTC (rev 90037)
+++ trunk/moon/src/dirty.cpp    2007-11-20 21:36:02 UTC (rev 90038)
@@ -43,8 +43,8 @@
        }
 
   // XXX this should really be here...
-//     if (element->dirty_flags & dirt)
-//             return;
+//     if (element->dirty_flags & dirt)
+//             return;
 
        element->dirty_flags |= dirt;
 
@@ -213,7 +213,7 @@
 //                                             printf (" + + + calling 
UpdateBounds and Invalidate on parent\n");
                                                el->parent->UpdateBounds();
                                                Region oregion = Region 
(obounds);
-                                               el->parent->ChildInvalidated 
(&oregion);
+                                               el->parent->Invalidate 
(&oregion);
                                        }
                                } 
                                
@@ -229,7 +229,6 @@
                        el->dirty_flags &= ~DirtyInvalidate;
 
                        Region *dirty = el->dirty_region;
-                       dirty->Union (el->children_dirty_region);
 
                        if (el->parent) {
 //                       printf (" + + invalidating parent (%f,%f,%f,%f)\n",
@@ -237,7 +236,7 @@
 //                               el->dirty_rect.y,
 //                               el->dirty_rect.w,
 //                               el->dirty_rect.h);
-                               el->parent->ChildInvalidated (dirty);
+                               el->parent->Invalidate (dirty);
                        }
                        else if (el->Is (Type::CANVAS) &&
                                 el->parent == NULL &&
@@ -265,8 +264,6 @@
 
                        delete el->dirty_region;
                        el->dirty_region = new Region ();
-                       delete el->children_dirty_region;
-                       el->children_dirty_region = new Region ();
                }
 
                if (!(el->dirty_flags & UpDirtyState)) {

Modified: trunk/moon/src/uielement.cpp
===================================================================
--- trunk/moon/src/uielement.cpp        2007-11-20 21:34:41 UTC (rev 90037)
+++ trunk/moon/src/uielement.cpp        2007-11-20 21:36:02 UTC (rev 90038)
@@ -57,7 +57,6 @@
        dirty_flags = 0;
        up_dirty_node = down_dirty_node = NULL;
        dirty_region = new Region ();
-       children_dirty_region = new Region ();
 
        this->SetValue (UIElement::TriggersProperty, Value::CreateUnref (new 
TriggerCollection ()));
        this->SetValue (UIElement::ResourcesProperty, Value::CreateUnref (new 
ResourceDictionary ()));
@@ -74,7 +73,6 @@
        }
        
        delete dirty_region;
-       delete children_dirty_region;
 
        remove_dirty_element (this);
 }
@@ -324,26 +322,6 @@
        }
 }
 
-void
-UIElement::ChildInvalidated (UIElement *child)
-{
-       Region region (child->GetBounds());
-       ChildInvalidated (&region);
-}
-
-void
-UIElement::ChildInvalidated (Region *region)
-{
-       if (!GetVisible() || total_opacity <= 0.0)
-               return;
-
-       add_dirty_element (this, DirtyInvalidate);
-
-       children_dirty_region->Union (region);
-
-       Emit (InvalidatedEvent);
-}
-
 //
 // Queues the invalidate for the current region, performs any 
 // updates to the RenderTransform (optional) and queues a 
@@ -371,6 +349,7 @@
                (int)(r.w+2), (int)(r.h+2));
 #endif
 
+
        add_dirty_element (this, DirtyInvalidate);
 
        dirty_region->Union (r);
@@ -379,6 +358,19 @@
 }
 
 void
+UIElement::Invalidate (Region *region)
+{
+       if (!GetVisible() || total_opacity <= 0.0)
+               return;
+
+       add_dirty_element (this, DirtyInvalidate);
+
+       dirty_region->Union (region);
+
+       Emit (InvalidatedEvent);
+}
+
+void
 UIElement::Invalidate ()
 {
        Invalidate (bounds);

Modified: trunk/moon/src/uielement.h
===================================================================
--- trunk/moon/src/uielement.h  2007-11-20 21:34:41 UTC (rev 90037)
+++ trunk/moon/src/uielement.h  2007-11-20 21:36:02 UTC (rev 90038)
@@ -54,7 +54,6 @@
        //Rect children_dirty_rect;
        bool force_invalidate_of_new_bounds;
        Region *dirty_region;
-       Region *children_dirty_region;
 
        int DumpHierarchy (UIElement *obj);
 
@@ -187,16 +186,17 @@
        // 
        bool InsideClip (cairo_t *cr, double x, double y);
 
-       void ChildInvalidated (UIElement *child);
-       void ChildInvalidated (Region *region);
-
        //
        // Invalidates a subrectangle of this element
        //
        void Invalidate (Rect r);
+
+       //
+       // Invalidates a subregion of this element
+       void Invalidate (Region *region);
        
        //
-       // Invalidates the items bounding rectangle on its surface
+       // Invalidates the entire bounding rectangle of this element
        //
        void Invalidate ();
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to