1
0
Fork 0
mutter-performance-source/cogl/winsys
Neil Roberts baa398b324 wayland: Always call wl_display_flush before going idle
Previously Cogl would only call wl_display_flush after doing a swap
buffers on the onscreen because that is the only place where Cogl
itself would end up queueing requests. However since commit
323fe188748 Cogl takes control of calling wl_display_dispatch as well
which effectively makes it very difficult for the application to
handle the Wayland event queue itself. Therefore it needs to rely on
Cogl to do it which means that other parts of the application may also
queue requests that need to be flushed.

This patch tries to copy the display fd handling of window.c in the
Weston example clients. wl_display_flush will always be called in
prepare function for the fd which means it will always be called
before going idle. If flushing the display causes the socket buffer to
become full, it will additionally poll for write on the FD to try
flushing again when it becomes empty.

We also need to call wl_display_dispatch_pending in the prepare
because apparently calling eglSwapBuffers can cause it to read data
from the FD to receive events for a different queue. In that case
there will be events that need to be handled but the FD will no longer
be ready for reading so we won't wake up the main loop any other way.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 962d1825105a87dd8358a765353b77f6af8fe760)
2013-07-01 13:47:48 +01:00
..
cogl-texture-pixmap-x11-private.h texture: add width/height members to base CoglTexture 2013-01-22 17:48:17 +00:00
cogl-texture-pixmap-x11.c Allow lazy texture storage allocation 2013-01-22 17:48:17 +00:00
cogl-texture-pixmap-x11.h Fixes for --disable-glib 2013-01-22 17:48:05 +00:00
cogl-winsys-egl-android-private.h Add a separate winsys vtable for each EGL platform 2011-12-08 17:38:25 +00:00
cogl-winsys-egl-android.c Adds CoglError api 2013-01-22 17:47:39 +00:00
cogl-winsys-egl-feature-functions.h check the wayland buffer format when creating texture 2013-05-29 19:30:44 +01:00
cogl-winsys-egl-gdl-private.h Add a separate winsys vtable for each EGL platform 2011-12-08 17:38:25 +00:00
cogl-winsys-egl-gdl.c Adds CoglError api 2013-01-22 17:47:39 +00:00
cogl-winsys-egl-kms-private.h egl: Split out the KMS winsys as overrides of the EGL winsys 2011-12-09 17:29:49 +00:00
cogl-winsys-egl-kms.c poll: Add general way to hook into mainloop without fd 2013-05-28 21:36:03 +01:00
cogl-winsys-egl-null-private.h Add a separate winsys vtable for each EGL platform 2011-12-08 17:38:25 +00:00
cogl-winsys-egl-null.c Adds CoglError api 2013-01-22 17:47:39 +00:00
cogl-winsys-egl-private.h check the wayland buffer format when creating texture 2013-05-29 19:30:44 +01:00
cogl-winsys-egl-wayland-private.h Add a separate winsys vtable for each EGL platform 2011-12-08 17:38:25 +00:00
cogl-winsys-egl-wayland.c wayland: Always call wl_display_flush before going idle 2013-07-01 13:47:48 +01:00
cogl-winsys-egl-x11-private.h Rename the EGL_X11 winsys to EGL_XLIB 2011-12-14 16:40:26 +00:00
cogl-winsys-egl-x11.c egl-x11: Fix a crash when the app has non-Cogl windows 2013-06-21 14:13:09 +01:00
cogl-winsys-egl.c Fix a warning in the EGL winsys 2013-05-30 13:59:13 +01:00
cogl-winsys-glx-feature-functions.h onscreen: Add CoglFrameInfo and _add_frame_callback() api 2013-01-30 20:09:49 +00:00
cogl-winsys-glx-private.h Add -Wmissing-declarations to maintainer flags and fix problems 2012-03-06 18:45:44 +00:00
cogl-winsys-glx.c Add a callback to get dirty events from a CoglOnscreen 2013-05-30 13:42:56 +01:00
cogl-winsys-private.h Add fence API 2013-05-28 21:36:03 +01:00
cogl-winsys-sdl-private.h Add -Wmissing-declarations to maintainer flags and fix problems 2012-03-06 18:45:44 +00:00
cogl-winsys-sdl.c Add a callback to get dirty events from a CoglOnscreen 2013-05-30 13:42:56 +01:00
cogl-winsys-sdl2.c Add a callback to get dirty events from a CoglOnscreen 2013-05-30 13:42:56 +01:00
cogl-winsys-stub-private.h Make stub winsys into a proper winsys backend 2011-06-01 20:44:41 +01:00
cogl-winsys-stub.c onscreen: Adds swap_buffers_with_damage api 2013-04-30 16:39:31 +01:00
cogl-winsys-wgl-feature-functions.h Add a WGL winsys 2011-05-10 17:58:41 +01:00
cogl-winsys-wgl-private.h Add -Wmissing-declarations to maintainer flags and fix problems 2012-03-06 18:45:44 +00:00
cogl-winsys-wgl.c Add a callback to get dirty events from a CoglOnscreen 2013-05-30 13:42:56 +01:00
cogl-winsys.c Adds CoglError api 2013-01-22 17:47:39 +00:00