Remove per-backend CLUTTER_VBLANK envvar
We have a global flag we can use.
This commit is contained in:
parent
e8562089f6
commit
db211a2131
@ -63,8 +63,6 @@ struct _ClutterBackendCoglClass
|
||||
|
||||
GType _clutter_backend_cogl_get_type (void) G_GNUC_CONST;
|
||||
|
||||
const gchar *_clutter_backend_cogl_get_vblank (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_BACKEND_COGL_H__ */
|
||||
|
@ -102,7 +102,6 @@ clutter_stage_cogl_realize (ClutterStageWindow *stage_window)
|
||||
GError *error = NULL;
|
||||
gfloat width = 800;
|
||||
gfloat height = 600;
|
||||
const char *clutter_vblank;
|
||||
|
||||
CLUTTER_NOTE (BACKEND, "Realizing stage '%s' [%p]",
|
||||
G_OBJECT_TYPE_NAME (stage_cogl),
|
||||
@ -116,9 +115,8 @@ clutter_stage_cogl_realize (ClutterStageWindow *stage_window)
|
||||
width, height);
|
||||
}
|
||||
|
||||
clutter_vblank = _clutter_backend_cogl_get_vblank ();
|
||||
if (clutter_vblank && strcmp (clutter_vblank, "none") == 0)
|
||||
cogl_onscreen_set_swap_throttled (stage_cogl->onscreen, FALSE);
|
||||
cogl_onscreen_set_swap_throttled (stage_cogl->onscreen,
|
||||
_clutter_get_sync_to_vblank ());
|
||||
|
||||
framebuffer = COGL_FRAMEBUFFER (stage_cogl->onscreen);
|
||||
if (!cogl_framebuffer_allocate (framebuffer, &error))
|
||||
|
@ -47,34 +47,11 @@ typedef int (WINAPI * SwapIntervalProc) (int interval);
|
||||
/* singleton object */
|
||||
static ClutterBackendWin32 *backend_singleton = NULL;
|
||||
|
||||
static gchar *clutter_vblank_name = NULL;
|
||||
|
||||
static HINSTANCE clutter_hinst = NULL;
|
||||
|
||||
/* various flags corresponding to pre init setup calls */
|
||||
static gboolean _no_event_retrieval = FALSE;
|
||||
|
||||
const gchar *
|
||||
_clutter_backend_win32_get_vblank (void)
|
||||
{
|
||||
if (clutter_vblank_name && strcmp (clutter_vblank_name, "0") == 0)
|
||||
return "none";
|
||||
else
|
||||
return clutter_vblank_name;
|
||||
}
|
||||
|
||||
gboolean
|
||||
clutter_backend_win32_pre_parse (ClutterBackend *backend,
|
||||
GError **error)
|
||||
{
|
||||
const gchar *env_string;
|
||||
|
||||
if ((env_string = g_getenv ("CLUTTER_VBLANK")))
|
||||
clutter_vblank_name = g_strdup (env_string);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_backend_win32_init_events (ClutterBackend *backend)
|
||||
{
|
||||
@ -259,7 +236,6 @@ clutter_backend_win32_class_init (ClutterBackendWin32Class *klass)
|
||||
gobject_class->dispose = clutter_backend_win32_dispose;
|
||||
gobject_class->finalize = clutter_backend_win32_finalize;
|
||||
|
||||
backend_class->pre_parse = clutter_backend_win32_pre_parse;
|
||||
backend_class->init_events = clutter_backend_win32_init_events;
|
||||
backend_class->create_stage = clutter_backend_win32_create_stage;
|
||||
backend_class->add_options = clutter_backend_win32_add_options;
|
||||
|
@ -72,8 +72,6 @@ clutter_backend_win32_get_features (ClutterBackend *backend);
|
||||
|
||||
HCURSOR _clutter_backend_win32_get_invisible_cursor (ClutterBackend *backend);
|
||||
|
||||
const gchar *_clutter_backend_win32_get_vblank (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_BACKEND_WIN32_H__ */
|
||||
|
@ -398,7 +398,6 @@ clutter_stage_win32_realize (ClutterStageWindow *stage_window)
|
||||
gfloat width;
|
||||
gfloat height;
|
||||
GError *error = NULL;
|
||||
const char *clutter_vblank;
|
||||
|
||||
CLUTTER_NOTE (MISC, "Realizing main stage");
|
||||
|
||||
@ -470,9 +469,8 @@ clutter_stage_win32_realize (ClutterStageWindow *stage_window)
|
||||
cogl_win32_onscreen_set_foreign_window (stage_win32->onscreen,
|
||||
stage_win32->hwnd);
|
||||
|
||||
clutter_vblank = _clutter_backend_win32_get_vblank ();
|
||||
if (clutter_vblank && strcmp (clutter_vblank, "none") == 0)
|
||||
cogl_onscreen_set_swap_throttled (stage_win32->onscreen, FALSE);
|
||||
cogl_onscreen_set_swap_throttled (stage_win32->onscreen,
|
||||
_clutter_get_sync_to_vblank ());
|
||||
|
||||
framebuffer = COGL_FRAMEBUFFER (stage_win32->onscreen);
|
||||
if (!cogl_framebuffer_allocate (framebuffer, &error))
|
||||
|
@ -331,8 +331,7 @@ _clutter_backend_x11_pre_parse (ClutterBackend *backend,
|
||||
env_string = NULL;
|
||||
}
|
||||
|
||||
return CLUTTER_BACKEND_CLASS (clutter_backend_x11_parent_class)->pre_parse (backend,
|
||||
error);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -451,8 +450,7 @@ _clutter_backend_x11_post_parse (ClutterBackend *backend,
|
||||
(unsigned int) backend_x11->xwin_root,
|
||||
clutter_backend_get_resolution (backend));
|
||||
|
||||
return CLUTTER_BACKEND_CLASS (clutter_backend_x11_parent_class)->post_parse (backend,
|
||||
error);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user