summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-02-13 17:11:56 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-02-13 19:54:29 +0900
commit358f2898c5ee321caad32a4779cc577272ec9007 (patch)
tree29db74daeae2a1eab890949d657ad41964105b83 /src/lib/elementary
parent01931c4676ba3a55ca65cd2cd3c2b3e55804c1c8 (diff)
win: Make ELM_ACCEL work with msaa, depth & stencil
This makes the env var override and the elementary config global override on accel preference work for not only "gl" but also advanced configs such as "gl:msaa_high:depth:stencil"
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_win.c52
1 files changed, 22 insertions, 30 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 707f01f999..3f581d8928 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -4452,34 +4452,28 @@ _elm_win_cb_show(void *data EINA_UNUSED,
4452 _elm_win_state_eval_queue(); 4452 _elm_win_state_eval_queue();
4453} 4453}
4454 4454
4455static Eina_Bool 4455static inline const char *
4456_accel_is_gl(const char *accel) 4456_efl_ui_win_accel(Efl_Ui_Win_Data *sd)
4457{ 4457{
4458 const char *env = NULL; 4458 const char *str = sd->accel_pref;
4459 const char *str = NULL; 4459 const char *env;
4460 4460
4461 /* current elm config */ 4461 /* current elm config */
4462 if (_elm_config->accel) str = _elm_config->accel; 4462 if (!str)
4463 if (_elm_accel_preference) str = _elm_accel_preference; 4463 {
4464 4464 if (_elm_config->accel) str = _elm_config->accel;
4465 /* constructor function */ 4465 if (_elm_accel_preference) str = _elm_accel_preference;
4466 if (accel) str = accel; 4466 }
4467 4467
4468 /* global overrides */ 4468 /* global overrides */
4469 if ((_elm_config->accel_override) && (_elm_config->accel)) 4469 if ((_elm_config->accel_override) && (_elm_config->accel))
4470 str = _elm_config->accel; 4470 str = _elm_config->accel;
4471
4472 /* env var wins */
4471 env = getenv("ELM_ACCEL"); 4473 env = getenv("ELM_ACCEL");
4472 if (env) str = env; 4474 if (env) str = env;
4473 if ((str) && 4475
4474 ((!strcasecmp(str, "gl")) || 4476 return str;
4475 (!strcasecmp(str, "opengl")) ||
4476 (!strcasecmp(str, "3d")) ||
4477 (!strcasecmp(str, "hw")) ||
4478 (!strcasecmp(str, "accel")) ||
4479 (!strcasecmp(str, "hardware"))
4480 ))
4481 return EINA_TRUE;
4482 return EINA_FALSE;
4483} 4477}
4484 4478
4485static inline void 4479static inline void
@@ -4515,6 +4509,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4515 int gl_stencil = _elm_config->gl_stencil; 4509 int gl_stencil = _elm_config->gl_stencil;
4516 int gl_msaa = _elm_config->gl_msaa; 4510 int gl_msaa = _elm_config->gl_msaa;
4517 Eina_Stringshare *accel = NULL; 4511 Eina_Stringshare *accel = NULL;
4512 Eina_Bool is_gl_accel;
4518 int i, p = 0; 4513 int i, p = 0;
4519 4514
4520 Efl_Ui_Win_Data tmp_sd; 4515 Efl_Ui_Win_Data tmp_sd;
@@ -4524,11 +4519,8 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4524 /* just to store some data while trying out to create a canvas */ 4519 /* just to store some data while trying out to create a canvas */
4525 memset(&tmp_sd, 0, sizeof(Efl_Ui_Win_Data)); 4520 memset(&tmp_sd, 0, sizeof(Efl_Ui_Win_Data));
4526 4521
4527 if (sd->accel_pref) 4522 is_gl_accel = _elm_config_accel_preference_parse
4528 { 4523 (_efl_ui_win_accel(sd), &accel, &gl_depth, &gl_stencil, &gl_msaa);
4529 _elm_config_accel_preference_parse(sd->accel_pref, &accel, &gl_depth,
4530 &gl_stencil, &gl_msaa);
4531 }
4532 4524
4533 switch (type) 4525 switch (type)
4534 { 4526 {
@@ -4580,7 +4572,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4580#ifdef HAVE_ELEMENTARY_X 4572#ifdef HAVE_ELEMENTARY_X
4581 else if ((disp) && (!strcmp(disp, "x11"))) 4573 else if ((disp) && (!strcmp(disp, "x11")))
4582 { 4574 {
4583 if (_accel_is_gl(accel)) 4575 if (is_gl_accel)
4584 { 4576 {
4585 enginelist[p++] = ELM_OPENGL_X11; 4577 enginelist[p++] = ELM_OPENGL_X11;
4586 enginelist[p++] = ELM_SOFTWARE_X11; 4578 enginelist[p++] = ELM_SOFTWARE_X11;
@@ -4596,7 +4588,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4596#ifdef HAVE_ELEMENTARY_WL2 4588#ifdef HAVE_ELEMENTARY_WL2
4597 else if ((disp) && (!strcmp(disp, "wl"))) 4589 else if ((disp) && (!strcmp(disp, "wl")))
4598 { 4590 {
4599 if (_accel_is_gl(accel)) 4591 if (is_gl_accel)
4600 { 4592 {
4601 enginelist[p++] = ELM_WAYLAND_EGL; 4593 enginelist[p++] = ELM_WAYLAND_EGL;
4602 enginelist[p++] = ELM_WAYLAND_SHM; 4594 enginelist[p++] = ELM_WAYLAND_SHM;
@@ -4620,7 +4612,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4620#ifdef HAVE_ELEMENTARY_SDL 4612#ifdef HAVE_ELEMENTARY_SDL
4621 else if ((disp) && (!strcmp(disp, "sdl"))) 4613 else if ((disp) && (!strcmp(disp, "sdl")))
4622 { 4614 {
4623 if (_accel_is_gl(accel)) 4615 if (is_hw_accel)
4624 { 4616 {
4625 enginelist[p++] = ELM_OPENGL_SDL; 4617 enginelist[p++] = ELM_OPENGL_SDL;
4626 enginelist[p++] = ELM_SOFTWARE_SDL; 4618 enginelist[p++] = ELM_SOFTWARE_SDL;
@@ -4662,7 +4654,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4662 else if (!_elm_preferred_engine && 4654 else if (!_elm_preferred_engine &&
4663 getenv("DISPLAY") && !getenv("ELM_ENGINE")) 4655 getenv("DISPLAY") && !getenv("ELM_ENGINE"))
4664 { 4656 {
4665 if (_accel_is_gl(accel)) 4657 if (is_gl_accel)
4666 { 4658 {
4667 enginelist[p++] = ELM_OPENGL_X11; 4659 enginelist[p++] = ELM_OPENGL_X11;
4668 enginelist[p++] = ELM_SOFTWARE_X11; 4660 enginelist[p++] = ELM_SOFTWARE_X11;
@@ -4678,7 +4670,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4678 else if (!_elm_preferred_engine && 4670 else if (!_elm_preferred_engine &&
4679 getenv("WAYLAND_DISPLAY") && !getenv("ELM_ENGINE")) 4671 getenv("WAYLAND_DISPLAY") && !getenv("ELM_ENGINE"))
4680 { 4672 {
4681 if (_accel_is_gl(accel)) 4673 if (is_gl_accel)
4682 { 4674 {
4683 enginelist[p++] = ELM_WAYLAND_EGL; 4675 enginelist[p++] = ELM_WAYLAND_EGL;
4684 enginelist[p++] = ELM_WAYLAND_SHM; 4676 enginelist[p++] = ELM_WAYLAND_SHM;
@@ -4692,7 +4684,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4692#endif 4684#endif
4693 else 4685 else
4694 { 4686 {
4695 if (_accel_is_gl(accel)) 4687 if (is_gl_accel)
4696 { 4688 {
4697// add all engines with selected engine first - if any 4689// add all engines with selected engine first - if any
4698 if (ENGINE_GET()) 4690 if (ENGINE_GET())