[gnome-shell] StBoxLayout: remove an incorrect drawing optimization



commit 1dd4c7140e295dacf7e1c167064df2a76fd460a9
Author: Dan Winship <danw gnome org>
Date:   Fri Mar 26 15:09:38 2010 -0400

    StBoxLayout: remove an incorrect drawing optimization
    
    Paint/pick all children, regardless of whether or not they lie within
    the content_box. The previous behavior was that a child that was 99%
    outside the box would be fully visible, but a child that was 100%
    outside the box would be fully hidden. This is somewhat odd, and
    doesn't match the behavior of the other St container classes, and at
    any rate, the use of clutter_actor_get_allocation_box() for this
    optimization was incorrect since it doesn't take into account
    transformations (anchor point, rotation, etc) that might cause the
    child to be drawn within the content_box anyway.
    
    (For scrolled StBoxLayouts, drawing is still clipped to the
    content_box, as before, but will now properly take transformations
    into account as well.)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=614047

 src/st/st-box-layout.c |   30 ++++--------------------------
 1 files changed, 4 insertions(+), 26 deletions(-)
---
diff --git a/src/st/st-box-layout.c b/src/st/st-box-layout.c
index b496110..0b47770 100644
--- a/src/st/st-box-layout.c
+++ b/src/st/st-box-layout.c
@@ -940,7 +940,6 @@ st_box_layout_paint (ClutterActor *actor)
   StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
   GList *l;
   gdouble x, y;
-  ClutterActorBox child_box;
   ClutterActorBox allocation_box;
   ClutterActorBox content_box;
 
@@ -993,18 +992,8 @@ st_box_layout_paint (ClutterActor *actor)
     {
       ClutterActor *child = (ClutterActor*) l->data;
 
-      if (!CLUTTER_ACTOR_IS_VISIBLE (child))
-        continue;
-
-      clutter_actor_get_allocation_box (child, &child_box);
-
-      if ((child_box.x1 < content_box.x2) &&
-          (child_box.x2 > content_box.x1) &&
-          (child_box.y1 < content_box.y2) &&
-          (child_box.y2 > content_box.y1))
-        {
-          clutter_actor_paint (child);
-        }
+      if (CLUTTER_ACTOR_IS_VISIBLE (child))
+        clutter_actor_paint (child);
     }
 
   if (priv->hadjustment || priv->vadjustment)
@@ -1019,7 +1008,6 @@ st_box_layout_pick (ClutterActor       *actor,
   StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
   GList *l;
   gdouble x, y;
-  ClutterActorBox child_box;
   ClutterActorBox allocation_box;
   ClutterActorBox content_box;
 
@@ -1067,18 +1055,8 @@ st_box_layout_pick (ClutterActor       *actor,
     {
       ClutterActor *child = (ClutterActor*) l->data;
 
-      if (!CLUTTER_ACTOR_IS_VISIBLE (child))
-        continue;
-
-      clutter_actor_get_allocation_box (child, &child_box);
-
-      if ((child_box.x1 < content_box.x2) &&
-          (child_box.x2 > content_box.x1) &&
-          (child_box.y1 < content_box.y2) &&
-          (child_box.y2 > content_box.y1))
-        {
-          clutter_actor_paint (child);
-        }
+      if (CLUTTER_ACTOR_IS_VISIBLE (child))
+        clutter_actor_paint (child);
     }
 
   if (priv->hadjustment || priv->vadjustment)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]