From d620189ae3e97de17dfa5c3c43efce8298af6705 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sun, 30 Apr 2017 17:00:18 +0200 Subject: [PATCH] ClutterActor: Call queue_redraw vfunc directly if possible Reduces some signal emission overhead. https://bugzilla.gnome.org/show_bug.cgi?id=782344 --- clutter/clutter/clutter-actor.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 85fcda532..6954f0396 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -2656,7 +2656,15 @@ _clutter_actor_signal_queue_redraw (ClutterActor *self, _clutter_actor_queue_redraw_on_clones (self); /* calls klass->queue_redraw in default handler */ - g_signal_emit (self, actor_signals[QUEUE_REDRAW], 0, origin); + if (g_signal_has_handler_pending (self, actor_signals[QUEUE_REDRAW], + 0, TRUE)) + { + g_signal_emit (self, actor_signals[QUEUE_REDRAW], 0, origin); + } + else + { + CLUTTER_ACTOR_GET_CLASS (self)->queue_redraw (self, origin); + } } static void