From ca33ad06487bf75e3196f5daca3041c6c615bb5e Mon Sep 17 00:00:00 2001 From: Gwanglim Lee Date: Thu, 12 May 2011 21:55:04 +0900 Subject: [PATCH] [elm_config] Merge SVN Revision 59321 "elm can now set vsync for gl windows/client" + enabled vsync by default for the SLP ELM configuration. --- config/default/base.src | 1 + config/illume/base.src | 1 + config/slp/base.src | 1 + config/standard/base.src | 1 + src/lib/elm_config.c | 5 +++++ src/lib/elm_priv.h | 1 + src/lib/elm_win.c | 15 ++++++++++++++- 7 files changed, 24 insertions(+), 1 deletion(-) diff --git a/config/default/base.src b/config/default/base.src index 1c94485..d5f558a 100644 --- a/config/default/base.src +++ b/config/default/base.src @@ -1,6 +1,7 @@ group "Elm_Config" struct { value "config_version" int: 65539; value "engine" string: "software_x11"; + value "vsync" uchar: 0; value "thumbscroll_enable" uchar: 1; value "thumbscroll_threshold" int: 24; value "thumbscroll_momentum_threshold" double: 100.0; diff --git a/config/illume/base.src b/config/illume/base.src index 1c94485..d5f558a 100644 --- a/config/illume/base.src +++ b/config/illume/base.src @@ -1,6 +1,7 @@ group "Elm_Config" struct { value "config_version" int: 65539; value "engine" string: "software_x11"; + value "vsync" uchar: 0; value "thumbscroll_enable" uchar: 1; value "thumbscroll_threshold" int: 24; value "thumbscroll_momentum_threshold" double: 100.0; diff --git a/config/slp/base.src b/config/slp/base.src index 820feb6..ab57ee7 100644 --- a/config/slp/base.src +++ b/config/slp/base.src @@ -1,6 +1,7 @@ group "Elm_Config" struct { value "config_version" int: 65539; value "engine" string: "software_x11"; + value "vsync" uchar: 1; value "thumbscroll_enable" uchar: 1; value "thumbscroll_threshold" int: 24; value "thumbscroll_momentum_threshold" double: 100.0; diff --git a/config/standard/base.src b/config/standard/base.src index 0c7d1c7..3b18fa1 100644 --- a/config/standard/base.src +++ b/config/standard/base.src @@ -1,6 +1,7 @@ group "Elm_Config" struct { value "config_version" int: 65539; value "engine" string: "software_x11"; + value "vsync" uchar: 0; value "thumbscroll_enable" uchar: 0; value "thumbscroll_threshold" int: 4; value "thumbscroll_momentum_threshold" double: 100.0; diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c index d265884..d54f69d 100644 --- a/src/lib/elm_config.c +++ b/src/lib/elm_config.c @@ -623,6 +623,7 @@ _desc_init(void) #define D _config_edd ELM_CONFIG_VAL(D, T, config_version, T_INT); ELM_CONFIG_VAL(D, T, engine, T_STRING); + ELM_CONFIG_VAL(D, T, vsync, T_UCHAR); ELM_CONFIG_VAL(D, T, thumbscroll_enable, T_UCHAR); ELM_CONFIG_VAL(D, T, thumbscroll_threshold, T_INT); ELM_CONFIG_VAL(D, T, thumbscroll_momentum_threshold, T_DOUBLE); @@ -1177,6 +1178,7 @@ _config_load(void) _elm_config = ELM_NEW(Elm_Config); _elm_config->config_version = ELM_CONFIG_VERSION; _elm_config->engine = eina_stringshare_add("software_x11"); + _elm_config->vsync = 0; _elm_config->thumbscroll_enable = EINA_TRUE; _elm_config->thumbscroll_threshold = 24; _elm_config->thumbscroll_momentum_threshold = 100.0; @@ -1501,6 +1503,9 @@ _env_get(void) (!strcasecmp(s, "software_16_wince_gdi"))) eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_16_WINCE); } + + s = getenv("ELM_VSYNC"); + if (s) _elm_config->vsync = !!atoi(s); s = getenv("ELM_THUMBSCROLL_ENABLE"); if (s) _elm_config->thumbscroll_enable = !!atoi(s); diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index 164eb9d..3d371a3 100644 --- a/src/lib/elm_priv.h +++ b/src/lib/elm_priv.h @@ -153,6 +153,7 @@ struct _Elm_Config { int config_version; const char *engine; + unsigned char vsync; unsigned char thumbscroll_enable; int thumbscroll_threshold; double thumbscroll_momentum_threshold; diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 2cd389c..5c44bbc 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -1021,7 +1021,20 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type) } else if (ENGINE_COMPARE(ELM_OPENGL_X11)) { - win->ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1); + int opt[10]; + int opt_i = 0; + + if (_elm_config->vsync) + { + opt[opt_i] = ECORE_EVAS_GL_X11_OPT_VSYNC; + opt_i++; + opt[opt_i] = 1; + opt_i++; + } + if (opt_i > 0) + win->ee = ecore_evas_gl_x11_options_new(NULL, 0, 0, 0, 1, 1, opt); + else + win->ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1); FALLBACK_TRY("OpenGL"); #ifdef HAVE_ELEMENTARY_X win->client_message_handler = ecore_event_handler_add -- 2.7.4