mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
MetaRendererNative: Wait for the last flip callback before flipping
We might still end up in swap-buffer without the previous flip callback having been invoked. This can happen if there are two monitors, and we manage to draw before having all monitor flip callbacks invoked. https://bugzilla.gnome.org/show_bug.cgi?id=774923
This commit is contained in:
parent
77384ffa9a
commit
227187f1f1
@ -800,12 +800,22 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
|
|||||||
MetaRendererNative *renderer_native = egl_renderer->platform;
|
MetaRendererNative *renderer_native = egl_renderer->platform;
|
||||||
CoglOnscreenEGL *egl_onscreen = onscreen->winsys;
|
CoglOnscreenEGL *egl_onscreen = onscreen->winsys;
|
||||||
MetaOnscreenNative *onscreen_native = egl_onscreen->platform;
|
MetaOnscreenNative *onscreen_native = egl_onscreen->platform;
|
||||||
|
MetaBackend *backend = meta_get_backend ();
|
||||||
|
MetaMonitorManager *monitor_manager =
|
||||||
|
meta_backend_get_monitor_manager (backend);
|
||||||
|
MetaMonitorManagerKms *monitor_manager_kms =
|
||||||
|
META_MONITOR_MANAGER_KMS (monitor_manager);
|
||||||
CoglFrameInfo *frame_info;
|
CoglFrameInfo *frame_info;
|
||||||
|
|
||||||
frame_info = g_queue_peek_tail (&onscreen->pending_frame_infos);
|
frame_info = g_queue_peek_tail (&onscreen->pending_frame_infos);
|
||||||
frame_info->global_frame_counter = renderer_native->frame_counter;
|
frame_info->global_frame_counter = renderer_native->frame_counter;
|
||||||
|
|
||||||
g_warn_if_fail (!onscreen_native->pending_queue_swap_notify);
|
/*
|
||||||
|
* Wait for the flip callback before continuing, as we might have started the
|
||||||
|
* animation earlier due to the animation being driven by some other monitor.
|
||||||
|
*/
|
||||||
|
while (onscreen_native->pending_flips)
|
||||||
|
meta_monitor_manager_kms_wait_for_flip (monitor_manager_kms);
|
||||||
|
|
||||||
parent_vtable->onscreen_swap_buffers_with_damage (onscreen,
|
parent_vtable->onscreen_swap_buffers_with_damage (onscreen,
|
||||||
rectangles,
|
rectangles,
|
||||||
|
Loading…
Reference in New Issue
Block a user