static Eet_Data_Descriptor *_config_binding_modifier_edd = NULL;
const char *_elm_preferred_engine = NULL;
const char *_elm_accel_preference = NULL;
+const char *_elm_gl_preference = NULL;
Eina_List *_font_overlays_del = NULL;
Eina_List *_color_overlays_del = NULL;
_elm_config->win_auto_focus_enable = 1;
_elm_config->win_auto_focus_animate = 1;
_elm_config->atspi_mode = ELM_ATSPI_MODE_OFF;
+ _elm_config->gl_depth = 0;
+ _elm_config->gl_msaa = 0;
+ _elm_config->gl_stencil = 0;
}
static const char *
_config_load();
_env_get();
ELM_SAFE_FREE(_elm_accel_preference, eina_stringshare_del);
+ ELM_SAFE_FREE(_elm_gl_preference, eina_stringshare_del);
_translation_init();
_config_apply();
_elm_config_font_overlay_apply();
EAPI const char *
elm_config_accel_preference_get(void)
{
+ if (_elm_gl_preference) return _elm_gl_preference;
if (_elm_accel_preference) return _elm_accel_preference;
return _elm_config->accel;
}
{
if (pref)
{
- eina_stringshare_replace(&(_elm_accel_preference), pref);
- eina_stringshare_replace(&(_elm_config->accel), pref);
+ Eina_Bool is_hw_accel = EINA_FALSE;
+ unsigned int tokens = 0, i;
+ char **arr;
+
+ /* Accel preference's string has the window surface configuration as a hw accel, depth, stencil and msaa.
+ * The string format is "{HW Accel}:depth{value}:stencil{value}:msaa{msaa string}"
+ * Especially, msaa string is related Evas GL MSAA enum value(low, mid, high)
+ * so msaa string has four types as msaa, msaa_low, msaa_mid, msaa_high
+ * For instance, "opengl:depth24:stencil8:msaa_high".
+ * It means that using hw accelation, window surface depth buffer's size is 24, stencil buffer's size 8 and msaa bits is the highest.
+ * The other use-case is "opengl:depth24".
+ * It measn that using hw accelation, depth buffer size is 24. stencil and msaa are not used.
+ * The simple case is "opengl:depth:stencil:msaa".
+ * It means that depth, stencil and msaa are setted by pre-defined value(depth:24, stencil:8, msaa:low)
+ */
+
+ DBG("accel preference's string: %s",pref);
+ /* full string */
+ eina_stringshare_replace(&(_elm_gl_preference), pref);
+ ELM_SAFE_FREE(_elm_accel_preference, eina_stringshare_del);
+ ELM_SAFE_FREE(_elm_config->accel, eina_stringshare_del);
+
+ /* split GL items (hw accel, gl depth, gl stencil, gl msaa */
+ arr = eina_str_split_full(pref, ":", 0, &tokens);
+ for (i = 0; arr && arr[i]; i++)
+ {
+ if ((!strcasecmp(arr[i], "gl")) ||
+ (!strcasecmp(arr[i], "opengl")) ||
+ (!strcasecmp(arr[i], "3d")) ||
+ (!strcasecmp(arr[i], "hw")) ||
+ (!strcasecmp(arr[i], "accel")) ||
+ (!strcasecmp(arr[i], "hardware"))
+ )
+ {
+ eina_stringshare_replace(&(_elm_accel_preference), arr[i]);
+ eina_stringshare_replace(&(_elm_config->accel), arr[i]);
+ is_hw_accel = EINA_TRUE;
+ }
+ else if (!strncmp(arr[i], "depth", 5))
+ {
+ char *value_str = arr[i] + 5;
+ if ((value_str) && (isdigit(*value_str)))
+ _elm_config->gl_depth = atoi(value_str);
+ else
+ _elm_config->gl_depth = 24;
+ }
+ else if (!strncmp(arr[i], "stencil", 7))
+ {
+ char *value_str = arr[i] + 7;
+ if ((value_str) && (isdigit(*value_str)))
+ _elm_config->gl_stencil = atoi(value_str);
+ else
+ _elm_config->gl_stencil = 8;
+ }
+ else if (!strncmp(arr[i], "msaa_low", 8))
+ _elm_config->gl_msaa = 1; // 1 means msaa low
+ else if (!strncmp(arr[i], "msaa_mid", 8))
+ _elm_config->gl_msaa = 2; // 2 means msaa mid
+ else if (!strncmp(arr[i], "msaa_high", 9))
+ _elm_config->gl_msaa = 4; // 4 means msaa high
+ else if (!strncmp(arr[i], "msaa", 4))
+ _elm_config->gl_msaa = 1; // 1 means msaa low
+ }
+
+ DBG("accel: %s", _elm_accel_preference);
+ DBG("gl depth: %d", _elm_config->gl_depth);
+ DBG("gl stencil: %d", _elm_config->gl_stencil);
+ DBG("gl msaa: %d", _elm_config->gl_msaa);
+ free(arr[0]);
+ free(arr);
+
+ if (is_hw_accel == EINA_FALSE)
+ {
+ ELM_SAFE_FREE(_elm_accel_preference, eina_stringshare_del);
+ ELM_SAFE_FREE(_elm_config->accel, eina_stringshare_del);
+ }
}
else
{
+ ELM_SAFE_FREE(_elm_gl_preference, eina_stringshare_del);
ELM_SAFE_FREE(_elm_accel_preference, eina_stringshare_del);
ELM_SAFE_FREE(_elm_config->accel, eina_stringshare_del);
}
tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
else if (!strcmp(enginelist[i], ELM_OPENGL_X11))
{
- int opt[10], opt_i = 0;
+ int opt[20], opt_i = 0;
if (_elm_config->vsync)
{
opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_VSYNC;
opt[opt_i++] = 1;
- opt[opt_i++] = 0;
}
+ if (_elm_config->gl_depth)
+ {
+ opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_GL_DEPTH;
+ opt[opt_i++] = _elm_config->gl_depth;
+ }
+ if (_elm_config->gl_stencil)
+ {
+ opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_GL_STENCIL;
+ opt[opt_i++] = _elm_config->gl_stencil;
+ }
+ if (_elm_config->gl_msaa)
+ {
+ opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_GL_MSAA;
+ opt[opt_i++] = _elm_config->gl_msaa;
+ }
+ opt[opt_i] = 0;
if (opt_i > 0)
tmp_sd.ee = ecore_evas_gl_x11_options_new(NULL, 0, 0, 0, 1, 1, opt);
else