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 698783 - Add a paint callback for ClutterStage
Add a paint callback for ClutterStage
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: ClutterStage
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks: 698794
 
 
Reported: 2013-04-24 19:40 UTC by Emmanuele Bassi (:ebassi)
Modified: 2013-05-06 17:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
stage: Add a paint callback (4.93 KB, patch)
2013-04-24 19:40 UTC, Emmanuele Bassi (:ebassi)
none Details | Review
stage: Add a paint callback / v2.0 (5.45 KB, patch)
2013-04-24 20:25 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
stage: Add a paint callback / v3.0 (5.98 KB, patch)
2013-04-24 20:34 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Emmanuele Bassi (:ebassi) 2013-04-24 19:40:04 UTC
Needed for the Shell. Using the repaint function is too late, as the Shell needs to get notified of the frame completion before we do a buffer swap.
Comment 1 Emmanuele Bassi (:ebassi) 2013-04-24 19:40:06 UTC
Created attachment 242361 [details] [review]
stage: Add a paint callback

The ClutterActor::paint signal is deprecated, and connecting to it even
to get notifications will disable clipped redraws because of violations
of the paint volume.

The only actual valid use case for notifications of a successful frame
is on the ClutterStage, so we should add new (experimental) API for it,
so that users can actually subscribe to it — at least if you're writing
a compositor.

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.
Comment 2 Emmanuele Bassi (:ebassi) 2013-04-24 20:25:45 UTC
Created attachment 242365 [details] [review]
stage: Add a paint callback / v2.0

Updated, now with a proper symbol for the callback type.
Comment 3 Emmanuele Bassi (:ebassi) 2013-04-24 20:34:30 UTC
Created attachment 242367 [details] [review]
stage: Add a paint callback / v3.0

This time, with a static invoke_paint_callback().
Comment 4 Owen Taylor 2013-04-24 20:47:39 UTC
Review of attachment 242367 [details] [review]:

Looks good, and fixes the problem with Mutter - the problem is that the CLUTTER_REPAINT_FLAGS_POST_PAINT function runs *after* swap, which is too late to send notifications back to a client, since Cogl blocks until VBlank in some cases, such as partial stage updates.
Comment 5 Emmanuele Bassi (:ebassi) 2013-05-06 17:06:19 UTC
Pushed to clutter-1.16, will be in the next snapshot