wayland/compositor: Process frame callbacks on 'after-update'

Instead of going via MetaCompositor to know about when we updated
(confusingly named post-paint), use the new stage signal directly.

Note that this doesn't change the time frame callbacks are dispatched;
it's still not tied to actual painting even though it seemed so before
given the function names.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
This commit is contained in:
Jonas Ådahl 2020-06-03 11:38:32 +02:00
parent 578c30792a
commit 8cff3b84f7
2 changed files with 8 additions and 9 deletions

View File

@ -1142,11 +1142,6 @@ meta_compositor_real_post_paint (MetaCompositor *compositor)
meta_compositor_get_instance_private (compositor);
CoglGraphicsResetStatus status;
#ifdef HAVE_WAYLAND
if (meta_is_wayland_compositor ())
meta_wayland_compositor_paint_finished (meta_wayland_compositor_get_default ());
#endif
status = cogl_get_graphics_reset_status (priv->context);
switch (status)
{

View File

@ -194,8 +194,9 @@ meta_wayland_compositor_update (MetaWaylandCompositor *compositor,
meta_wayland_seat_update (compositor->seat, event);
}
void
meta_wayland_compositor_paint_finished (MetaWaylandCompositor *compositor)
static void
on_after_update (ClutterStage *stage,
MetaWaylandCompositor *compositor)
{
GList *l;
int64_t now_us;
@ -397,9 +398,9 @@ meta_wayland_compositor_new (MetaBackend *backend)
}
void
meta_wayland_compositor_setup (MetaWaylandCompositor *wayland_compositor)
meta_wayland_compositor_setup (MetaWaylandCompositor *compositor)
{
MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
ClutterActor *stage = meta_backend_get_stage (compositor->backend);
GSource *wayland_event_source;
wayland_event_source = wayland_event_source_new (compositor->wayland_display);
@ -413,6 +414,9 @@ meta_wayland_compositor_setup (MetaWaylandCompositor *wayland_compositor)
g_source_set_priority (wayland_event_source, GDK_PRIORITY_EVENTS + 1);
g_source_attach (wayland_event_source, NULL);
g_signal_connect (stage, "after-update",
G_CALLBACK (on_after_update), compositor);
if (!wl_global_create (compositor->wayland_display,
&wl_compositor_interface,
META_WL_COMPOSITOR_VERSION,