[mutter] Connect to ClutterStage::after-paint with connect_after()



commit 182a267f69d353c82f829fb93ccf9e4592d2e648
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Wed Jul 16 10:41:48 2014 -0400

    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 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index 512364f..60a4c0b 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);
 


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