[clutter] actor: Annotate signals to enable some optimization



commit 708d385866645a9c7d6b90d477aff7b693879bb2
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Wed Mar 14 11:33:55 2012 +0000

    actor: Annotate signals to enable some optimization
    
    The ::paint, ::queue-redraw, and ::queue-relayout signals should be
    marked as no-recurse and no-hooks; these signals are emitted *a lot*
    during each frame, and since GLib has a bunch of optimizations for
    signals with no closures, we should try and squeeze every single CPU
    cycle we can.

 clutter/clutter-actor.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 348bb5c..ecf94e6 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -6045,7 +6045,9 @@ clutter_actor_class_init (ClutterActorClass *klass)
   actor_signals[QUEUE_REDRAW] =
     g_signal_new (I_("queue-redraw"),
 		  G_TYPE_FROM_CLASS (object_class),
-		  G_SIGNAL_RUN_LAST,
+		  G_SIGNAL_RUN_LAST |
+                  G_SIGNAL_NO_RECURSE |
+                  G_SIGNAL_NO_HOOKS,
 		  G_STRUCT_OFFSET (ClutterActorClass, queue_redraw),
 		  NULL, NULL,
 		  _clutter_marshal_VOID__OBJECT,
@@ -6072,7 +6074,9 @@ clutter_actor_class_init (ClutterActorClass *klass)
   actor_signals[QUEUE_RELAYOUT] =
     g_signal_new (I_("queue-relayout"),
 		  G_TYPE_FROM_CLASS (object_class),
-		  G_SIGNAL_RUN_LAST,
+		  G_SIGNAL_RUN_LAST |
+                  G_SIGNAL_NO_RECURSE |
+                  G_SIGNAL_NO_HOOKS,
 		  G_STRUCT_OFFSET (ClutterActorClass, queue_relayout),
 		  NULL, NULL,
 		  _clutter_marshal_VOID__VOID,
@@ -6359,7 +6363,9 @@ clutter_actor_class_init (ClutterActorClass *klass)
   actor_signals[PAINT] =
     g_signal_new (I_("paint"),
                   G_TYPE_FROM_CLASS (object_class),
-                  G_SIGNAL_RUN_LAST,
+                  G_SIGNAL_RUN_LAST |
+                  G_SIGNAL_NO_RECURSE |
+                  G_SIGNAL_NO_HOOKS,
                   G_STRUCT_OFFSET (ClutterActorClass, paint),
                   NULL, NULL,
                   _clutter_marshal_VOID__VOID,



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