[clutter/clutter-1.18] stage: re-implement minimal paint() method to respect Z order



commit 5d53620bb94e428f891d1d0c143c2afd47b1466b
Author: David Warman <dwarman manglebit org>
Date:   Tue Feb 25 18:14:00 2014 +0000

    stage: re-implement minimal paint() method to respect Z order
    
    Without a paint() implementation in clutter-stage, the function
    from clutter-group is used.  That class has its own child list,
    but attempts to use sort_depth_order, which is empty in this case.
    
    This provides a partial fix by replacing a minimal paint(), see:
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711645

 clutter/clutter-stage.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index 24f6759..356fa1e 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -691,6 +691,21 @@ _clutter_stage_do_paint (ClutterStage                *stage,
   clutter_stage_invoke_paint_callback (stage);
 }
 
+/* If we don't implement this here, we get the paint function
+ * from the deprecated clutter-group class, which doesn't
+ * respect the Z order as it uses our empty sort_depth_order.
+ */
+static void
+clutter_stage_paint (ClutterActor *self)
+{
+  ClutterActorIter iter;
+  ClutterActor *child;
+
+  clutter_actor_iter_init (&iter, self);
+  while (clutter_actor_iter_next (&iter, &child))
+    clutter_actor_paint (child);
+}
+
 #if 0
 /* the Stage is cleared in clutter_actor_paint_node() */
 static void
@@ -1873,6 +1888,7 @@ clutter_stage_class_init (ClutterStageClass *klass)
   actor_class->allocate = clutter_stage_allocate;
   actor_class->get_preferred_width = clutter_stage_get_preferred_width;
   actor_class->get_preferred_height = clutter_stage_get_preferred_height;
+  actor_class->paint = clutter_stage_paint;
   actor_class->pick = clutter_stage_pick;
   actor_class->get_paint_volume = clutter_stage_get_paint_volume;
   actor_class->realize = clutter_stage_realize;


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