mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
Call cogl_xlib_renderer_set_threaded_swap_wait_enabled()
Set up things so that if the INTEL_swap_event extension is not present, but the driver is known to have good thread support, we use an extra thread and call glXWaitVideoSync() in the thread. This allows idles to work properly, even when Mutter is constantly redrawing new frames; otherwise, without INTEL_swap_event, we'll just block in glXSwapBuffers(). https://bugzilla.gnome.org/show_bug.cgi?id=779039
This commit is contained in:
parent
d200868459
commit
383ba566bd
@ -605,6 +605,12 @@ meta_backend_x11_class_init (MetaBackendX11Class *klass)
|
||||
static void
|
||||
meta_backend_x11_init (MetaBackendX11 *x11)
|
||||
{
|
||||
/* XInitThreads() is needed to use the "threaded swap wait" functionality
|
||||
* in Cogl - see meta_renderer_x11_create_cogl_renderer(). We call it here
|
||||
* to hopefully call it before any other use of XLib.
|
||||
*/
|
||||
XInitThreads();
|
||||
|
||||
clutter_x11_request_reset_on_video_memory_purge ();
|
||||
|
||||
/* We do X11 event retrieval ourselves */
|
||||
|
@ -66,6 +66,14 @@ meta_renderer_x11_create_cogl_renderer (MetaRenderer *renderer)
|
||||
cogl_renderer_set_custom_winsys (cogl_renderer, get_x11_cogl_winsys_vtable);
|
||||
cogl_xlib_renderer_set_foreign_display (cogl_renderer, xdisplay);
|
||||
|
||||
/* Set up things so that if the INTEL_swap_event extension is not present,
|
||||
* but the driver is known to have good thread support, we use an extra
|
||||
* thread and call glXWaitVideoSync() in the thread. This allows idles
|
||||
* to work properly, even when Mutter is constantly redrawing new frames;
|
||||
* otherwise, without INTEL_swap_event, we'll just block in glXSwapBuffers().
|
||||
*/
|
||||
cogl_xlib_renderer_set_threaded_swap_wait_enabled (cogl_renderer, TRUE);
|
||||
|
||||
return cogl_renderer;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user