From 182a267f69d353c82f829fb93ccf9e4592d2e648 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Wed, 16 Jul 2014 10:41:48 -0400 Subject: [PATCH] Connect to ClutterStage::after-paint with connect_after() Use connect_after() to accomodate code in GNOME Shell that, when benchmarking drawing performance, connects to ::after-paint and calls glFinish(). The timing information from that will be more accurate if we hold off until that completes before we signal apps to begin drawing the next frame. If there are no other connections to ::after-paint, connect() vs. connect_after() doesn't matter. https://bugzilla.gnome.org/show_bug.cgi?id=732350 --- src/compositor/compositor.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 512364ff0..60a4c0b90 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -507,8 +507,16 @@ meta_compositor_manage (MetaCompositor *compositor) } } - g_signal_connect (CLUTTER_STAGE (compositor->stage), "after-paint", - G_CALLBACK (after_stage_paint), compositor); + /* We use connect_after() here to accomodate code in GNOME Shell that, + * when benchmarking drawing performance, connects to ::after-paint + * and calls glFinish(). The timing information from that will be + * more accurate if we hold off until that completes before we signal + * apps to begin drawing the next frame. If there are no other + * connections to ::after-paint, connect() vs. connect_after() doesn't + * matter. + */ + g_signal_connect_after (CLUTTER_STAGE (compositor->stage), "after-paint", + G_CALLBACK (after_stage_paint), compositor); clutter_stage_set_sync_delay (CLUTTER_STAGE (compositor->stage), META_SYNC_DELAY);