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)
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,
4962 _elm_win_state_eval_queue(); 4962 _elm_win_state_eval_queue();
4963} 4963}
4964 4964
4965static inline const char * 4965static inline Eina_Bool
4966_efl_ui_win_accel(Efl_Ui_Win_Data *sd) 4966_efl_ui_win_accel(Efl_Ui_Win_Data *sd, Eina_Stringshare **accel, int *gl_depth, int *gl_stencil, int *gl_msaa)
4967{ 4967{
4968 const char *str = sd->accel_pref; 4968 const char *str = sd->accel_pref;
4969 const char *env; 4969 const char *env;
4970 const char *cfg = NULL;
4971 Eina_Bool is_accel = EINA_FALSE;
4970 4972
4971 /* current elm config */ 4973 /* current elm config OR global override */
4972 if (!str) 4974 if ((!str) || ((_elm_config->accel_override) && (_elm_config->accel)))
4973 { 4975 {
4974 if (_elm_config->accel) str = _elm_config->accel; 4976 if (_elm_config->accel) cfg = _elm_config->accel;
4975 if (_elm_accel_preference) str = _elm_accel_preference; 4977 if (_elm_config->accel_override && _elm_accel_preference) cfg = _elm_accel_preference;
4976 } 4978 }
4977 4979
4978 /* global overrides */
4979 if ((_elm_config->accel_override) && (_elm_config->accel))
4980 str = _elm_config->accel;
4981
4982 /* env var wins */ 4980 /* env var wins */
4983 env = getenv("ELM_ACCEL"); 4981 env = getenv("ELM_ACCEL");
4984 if (env) str = env;
4985 4982
4986 return str; 4983 if (env)
4984 is_accel = _elm_config_accel_preference_parse(env, accel, gl_depth, gl_stencil, gl_msaa);
4985 else if (cfg)
4986 {
4987 is_accel = !!cfg;
4988 *accel = eina_stringshare_ref(cfg);
4989 *gl_depth = _elm_config->gl_depth;
4990 *gl_stencil = _elm_config->gl_stencil;
4991 *gl_msaa = _elm_config->gl_msaa;
4992 }
4993 else
4994 is_accel = _elm_config_accel_preference_parse(str, accel, gl_depth, gl_stencil, gl_msaa);
4995
4996 return is_accel;
4987} 4997}
4988 4998
4989static inline void 4999static inline void
@@ -5145,8 +5155,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
5145 /* just to store some data while trying out to create a canvas */ 5155 /* just to store some data while trying out to create a canvas */
5146 memset(&tmp_sd, 0, sizeof(Efl_Ui_Win_Data)); 5156 memset(&tmp_sd, 0, sizeof(Efl_Ui_Win_Data));
5147 5157
5148 is_gl_accel = _elm_config_accel_preference_parse 5158 is_gl_accel = _efl_ui_win_accel(sd, &accel, &gl_depth, &gl_stencil, &gl_msaa);
5149 (_efl_ui_win_accel(sd), &accel, &gl_depth, &gl_stencil, &gl_msaa);
5150 5159
5151 switch ((int) type) 5160 switch ((int) type)
5152 { 5161 {