summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-03-18 09:27:14 -0400
committerCedric BAIL <cedric.bail@free.fr>2019-03-20 12:36:50 -0700
commitb8ff87fc1d4945ca0a78f9eaffceba1c4a3cb1c0 (patch)
tree9b1fbc4257e991144af6f1ebf9eabb5137944862
parentbc03654caf091afde3840f555af66953ffece6cf (diff)
downloadefl-b8ff87fc1d4945ca0a78f9eaffceba1c4a3cb1c0.tar.gz
efl_ui_win: fix hw accel detection
the ordering of priority here is supposed to be: 1. env vars 2. global override config 3. window config 4. global config in the case where 1 and 3 were not set, however, this would end up mangling the global config values and not using the gl options @fix Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D8389
-rw-r--r--src/lib/elementary/efl_ui_win.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 150ac4d177..9a827d220c 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -4962,28 +4962,38 @@ _elm_win_cb_show(void *data EINA_UNUSED,
_elm_win_state_eval_queue();
}
-static inline const char *
-_efl_ui_win_accel(Efl_Ui_Win_Data *sd)
+static inline Eina_Bool
+_efl_ui_win_accel(Efl_Ui_Win_Data *sd, Eina_Stringshare **accel, int *gl_depth, int *gl_stencil, int *gl_msaa)
{
const char *str = sd->accel_pref;
const char *env;
+ const char *cfg = NULL;
+ Eina_Bool is_accel = EINA_FALSE;
- /* current elm config */
- if (!str)
+ /* current elm config OR global override */
+ if ((!str) || ((_elm_config->accel_override) && (_elm_config->accel)))
{
- if (_elm_config->accel) str = _elm_config->accel;
- if (_elm_accel_preference) str = _elm_accel_preference;
+ if (_elm_config->accel) cfg = _elm_config->accel;
+ if (_elm_config->accel_override && _elm_accel_preference) cfg = _elm_accel_preference;
}
- /* global overrides */
- if ((_elm_config->accel_override) && (_elm_config->accel))
- str = _elm_config->accel;
-
/* env var wins */
env = getenv("ELM_ACCEL");
- if (env) str = env;
- return str;
+ if (env)
+ is_accel = _elm_config_accel_preference_parse(env, accel, gl_depth, gl_stencil, gl_msaa);
+ else if (cfg)
+ {
+ is_accel = !!cfg;
+ *accel = eina_stringshare_ref(cfg);
+ *gl_depth = _elm_config->gl_depth;
+ *gl_stencil = _elm_config->gl_stencil;
+ *gl_msaa = _elm_config->gl_msaa;
+ }
+ else
+ is_accel = _elm_config_accel_preference_parse(str, accel, gl_depth, gl_stencil, gl_msaa);
+
+ return is_accel;
}
static inline void
@@ -5145,8 +5155,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
/* just to store some data while trying out to create a canvas */
memset(&tmp_sd, 0, sizeof(Efl_Ui_Win_Data));
- is_gl_accel = _elm_config_accel_preference_parse
- (_efl_ui_win_accel(sd), &accel, &gl_depth, &gl_stencil, &gl_msaa);
+ is_gl_accel = _efl_ui_win_accel(sd, &accel, &gl_depth, &gl_stencil, &gl_msaa);
switch ((int) type)
{