GNOME Bugzilla – Bug 732342
ClutterStage: Add an ::after-paint signal
Last modified: 2014-06-27 18:40:39 UTC
This is basically a replacement for clutter_stage_set_paint_callback() - I tried to use clutter_stage_set_paint_callback() in gnome-shell, overwrote the function installed on the same hook by Mutter and confused myself for half an hour about why things broke (even though I added the usage in Mutter.) In: https://bugzilla.gnome.org/show_bug.cgi?id=698783 You wrote: Shoving a signal in a performance critical path is not an option, and I'm not sure I want to commit to an API like this yet. I reserve the right to revisit this decision in the future. This is called *once* per frame. The glib performance tests indicate that GLib can emit 10 million unconnected signals without a default handler per frame. (0.1 microseconds out of the 16000 microsecond frame budget.) So I don't see it as a big bottleneck. But if you really don't want a signal here I can multiplex set_paint_callback in Mutter instead - the reason I'm proposing a Clutter patch is that the single caller API is a bit of a trap.
Created attachment 279393 [details] [review] ClutterStage: Add an ::after-paint signal clutter_stage_set_paint_callback() has the disadvantage that it only works for a single caller, and subsequent callers will overwrite and break previous callers. Add an ::after-paint signal that is emitted at the same point - after all painting for the stage is completed but before the drawing is presented to the screen.
Created attachment 279427 [details] [review] ClutterStage: Replace clutter_stage_set_paint_callback() with ::after-paint signal Here's a version that (at Emannuele's suggestion) just rips out te old experimental function. Will have to be pushed together with a Mutter fix. === clutter_stage_set_paint_callback() has the disadvantage that it only works for a single caller, and subsequent callers will overwrite and break previous callers. Replace it with an ::after-paint signal that is emitted at the same point - after all painting for the stage is completed but before the drawing is presented to the screen.
Attachment 279427 [details] pushed as ec911dc - ClutterStage: Replace clutter_stage_set_paint_callback() with ::after-paint signal