After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732342 - ClutterStage: Add an ::after-paint signal
ClutterStage: Add an ::after-paint signal
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-06-27 13:19 UTC by Owen Taylor
Modified: 2014-06-27 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ClutterStage: Add an ::after-paint signal (2.04 KB, patch)
2014-06-27 13:19 UTC, Owen Taylor
none Details | Review
ClutterStage: Replace clutter_stage_set_paint_callback() with ::after-paint signal (4.63 KB, patch)
2014-06-27 17:59 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2014-06-27 13:19:54 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.
Comment 1 Owen Taylor 2014-06-27 13:19:56 UTC
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.
Comment 2 Owen Taylor 2014-06-27 17:59:43 UTC
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.
Comment 3 Owen Taylor 2014-06-27 18:40:35 UTC
Attachment 279427 [details] pushed as ec911dc - ClutterStage: Replace clutter_stage_set_paint_callback() with ::after-paint signal