From 708d385866645a9c7d6b90d477aff7b693879bb2 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 14 Mar 2012 11:33:55 +0000 Subject: [PATCH] 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 file changed, 9 insertions(+), 3 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 348bb5cc9..ecf94e68a 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,