Remove per-backend CLUTTER_VBLANK envvar

We have a global flag we can use.
This commit is contained in:
Emmanuele Bassi 2011-11-04 16:39:52 +00:00
parent e8562089f6
commit db211a2131
6 changed files with 6 additions and 40 deletions

View File

@ -63,8 +63,6 @@ struct _ClutterBackendCoglClass
GType _clutter_backend_cogl_get_type (void) G_GNUC_CONST; GType _clutter_backend_cogl_get_type (void) G_GNUC_CONST;
const gchar *_clutter_backend_cogl_get_vblank (void);
G_END_DECLS G_END_DECLS
#endif /* __CLUTTER_BACKEND_COGL_H__ */ #endif /* __CLUTTER_BACKEND_COGL_H__ */

View File

@ -102,7 +102,6 @@ clutter_stage_cogl_realize (ClutterStageWindow *stage_window)
GError *error = NULL; GError *error = NULL;
gfloat width = 800; gfloat width = 800;
gfloat height = 600; gfloat height = 600;
const char *clutter_vblank;
CLUTTER_NOTE (BACKEND, "Realizing stage '%s' [%p]", CLUTTER_NOTE (BACKEND, "Realizing stage '%s' [%p]",
G_OBJECT_TYPE_NAME (stage_cogl), G_OBJECT_TYPE_NAME (stage_cogl),
@ -116,9 +115,8 @@ clutter_stage_cogl_realize (ClutterStageWindow *stage_window)
width, height); width, height);
} }
clutter_vblank = _clutter_backend_cogl_get_vblank (); cogl_onscreen_set_swap_throttled (stage_cogl->onscreen,
if (clutter_vblank && strcmp (clutter_vblank, "none") == 0) _clutter_get_sync_to_vblank ());
cogl_onscreen_set_swap_throttled (stage_cogl->onscreen, FALSE);
framebuffer = COGL_FRAMEBUFFER (stage_cogl->onscreen); framebuffer = COGL_FRAMEBUFFER (stage_cogl->onscreen);
if (!cogl_framebuffer_allocate (framebuffer, &error)) if (!cogl_framebuffer_allocate (framebuffer, &error))

View File

@ -47,34 +47,11 @@ typedef int (WINAPI * SwapIntervalProc) (int interval);
/* singleton object */ /* singleton object */
static ClutterBackendWin32 *backend_singleton = NULL; static ClutterBackendWin32 *backend_singleton = NULL;
static gchar *clutter_vblank_name = NULL;
static HINSTANCE clutter_hinst = NULL; static HINSTANCE clutter_hinst = NULL;
/* various flags corresponding to pre init setup calls */ /* various flags corresponding to pre init setup calls */
static gboolean _no_event_retrieval = FALSE; 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 static void
clutter_backend_win32_init_events (ClutterBackend *backend) 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->dispose = clutter_backend_win32_dispose;
gobject_class->finalize = clutter_backend_win32_finalize; 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->init_events = clutter_backend_win32_init_events;
backend_class->create_stage = clutter_backend_win32_create_stage; backend_class->create_stage = clutter_backend_win32_create_stage;
backend_class->add_options = clutter_backend_win32_add_options; backend_class->add_options = clutter_backend_win32_add_options;

View File

@ -72,8 +72,6 @@ clutter_backend_win32_get_features (ClutterBackend *backend);
HCURSOR _clutter_backend_win32_get_invisible_cursor (ClutterBackend *backend); HCURSOR _clutter_backend_win32_get_invisible_cursor (ClutterBackend *backend);
const gchar *_clutter_backend_win32_get_vblank (void);
G_END_DECLS G_END_DECLS
#endif /* __CLUTTER_BACKEND_WIN32_H__ */ #endif /* __CLUTTER_BACKEND_WIN32_H__ */

View File

@ -398,7 +398,6 @@ clutter_stage_win32_realize (ClutterStageWindow *stage_window)
gfloat width; gfloat width;
gfloat height; gfloat height;
GError *error = NULL; GError *error = NULL;
const char *clutter_vblank;
CLUTTER_NOTE (MISC, "Realizing main stage"); 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, cogl_win32_onscreen_set_foreign_window (stage_win32->onscreen,
stage_win32->hwnd); stage_win32->hwnd);
clutter_vblank = _clutter_backend_win32_get_vblank (); cogl_onscreen_set_swap_throttled (stage_win32->onscreen,
if (clutter_vblank && strcmp (clutter_vblank, "none") == 0) _clutter_get_sync_to_vblank ());
cogl_onscreen_set_swap_throttled (stage_win32->onscreen, FALSE);
framebuffer = COGL_FRAMEBUFFER (stage_win32->onscreen); framebuffer = COGL_FRAMEBUFFER (stage_win32->onscreen);
if (!cogl_framebuffer_allocate (framebuffer, &error)) if (!cogl_framebuffer_allocate (framebuffer, &error))

View File

@ -331,8 +331,7 @@ _clutter_backend_x11_pre_parse (ClutterBackend *backend,
env_string = NULL; env_string = NULL;
} }
return CLUTTER_BACKEND_CLASS (clutter_backend_x11_parent_class)->pre_parse (backend, return TRUE;
error);
} }
gboolean gboolean
@ -451,8 +450,7 @@ _clutter_backend_x11_post_parse (ClutterBackend *backend,
(unsigned int) backend_x11->xwin_root, (unsigned int) backend_x11->xwin_root,
clutter_backend_get_resolution (backend)); clutter_backend_get_resolution (backend));
return CLUTTER_BACKEND_CLASS (clutter_backend_x11_parent_class)->post_parse (backend, return TRUE;
error);
} }
void void