debug: Adds CLUTTER_DEBUG=disable-swap-events option

This allows us to forcibly disable the use of the GLX_INTEL_swap_events
extension for testing or debugging purposes.
This commit is contained in:
Robert Bragg
2010-01-20 18:53:36 +00:00
parent 5d702853b8
commit 4a9f08639f
3 changed files with 23 additions and 20 deletions

View File

@@ -331,7 +331,8 @@ clutter_backend_glx_get_features (ClutterBackend *backend)
/* GLX_INTEL_swap_event allows us to avoid blocking the CPU while
* we wait for glXSwapBuffers to complete, and instead we get an X
* event notifying us of completion... */
if (cogl_check_extension ("GLX_INTEL_swap_event", glx_extensions) &&
if (!(clutter_debug_flags & CLUTTER_DEBUG_DISABLE_SWAP_EVENTS) &&
cogl_check_extension ("GLX_INTEL_swap_event", glx_extensions) &&
flags & CLUTTER_FEATURE_SYNC_TO_VBLANK)
flags |= CLUTTER_FEATURE_SWAP_EVENTS;
#endif /* GLX_INTEL_swap_event */