mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
Add synchronise support to the GLX backend
This patch adds a command line switch to make every X call synchronous. It's only useful for debugging purposes, so it will not be displayed when calling a Clutter application with --help.
This commit is contained in:
parent
61db350ca4
commit
b66593374d
@ -60,6 +60,7 @@ static ClutterBackendGLX *backend_singleton = NULL;
|
||||
/* options */
|
||||
static gchar *clutter_display_name = NULL;
|
||||
static gint clutter_screen = 0;
|
||||
static gboolean clutter_synchronise = FALSE;
|
||||
|
||||
/* X error trap */
|
||||
static int TrappedErrorCode = 0;
|
||||
@ -203,6 +204,8 @@ clutter_backend_glx_post_parse (ClutterBackend *backend,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (clutter_synchronise)
|
||||
XSynchronize (backend_glx->xdpy, True);
|
||||
}
|
||||
|
||||
g_free (clutter_display_name);
|
||||
@ -290,10 +293,15 @@ static const GOptionEntry entries[] =
|
||||
"X screen to use", "SCREEN"
|
||||
},
|
||||
{ "vblank", 0,
|
||||
G_OPTION_FLAG_IN_MAIN,
|
||||
0,
|
||||
G_OPTION_ARG_STRING, &clutter_vblank_name,
|
||||
"VBlank method to be used (none, dri or glx)", "METHOD"
|
||||
},
|
||||
{ "synch", 0,
|
||||
0,
|
||||
G_OPTION_ARG_NONE, &clutter_synchronise,
|
||||
"Make X calls synchronous", NULL,
|
||||
},
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@ -425,8 +433,8 @@ clutter_backend_glx_get_features (ClutterBackend *backend)
|
||||
glGetString (GL_VERSION),
|
||||
glGetString (GL_EXTENSIONS));
|
||||
|
||||
glx_extensions
|
||||
= glXQueryExtensionsString (clutter_glx_get_default_display (),
|
||||
glx_extensions =
|
||||
glXQueryExtensionsString (clutter_glx_get_default_display (),
|
||||
clutter_glx_get_default_screen ());
|
||||
|
||||
CLUTTER_NOTE (BACKEND, "GLX Extensions: %s", glx_extensions);
|
||||
@ -536,7 +544,7 @@ clutter_backend_glx_redraw (ClutterBackend *backend)
|
||||
|
||||
stage_glx = CLUTTER_STAGE_GLX(backend_glx->stage);
|
||||
|
||||
clutter_actor_paint (CLUTTER_ACTOR(stage_glx));
|
||||
clutter_actor_paint (CLUTTER_ACTOR (stage_glx));
|
||||
|
||||
/* Why this paint is done in backend as likely GL windowing system
|
||||
* specific calls, like swapping buffers.
|
||||
|
Loading…
Reference in New Issue
Block a user