aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-28 16:28:31 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-28 16:28:31 +0900
commit67420680fecc872fff99646fb0be4e7b88f371f9 (patch)
tree693c27b8adadad9a44e02747c2e20f982d21dcf7 /legacy/elementary/src/lib/elm_win.c
parentfix my theme version fix to not version extns/overlays (diff)
downloadefl-67420680fecc872fff99646fb0be4e7b88f371f9.tar.gz
win - reduce code duplication and move accel prefernce into single func
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c56
1 files changed, 20 insertions, 36 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index 6c0bf7b721..45682f08e2 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -2842,6 +2842,22 @@ _window_layout_stack(Evas_Object *o, Evas_Object_Box_Data *p, void *data)
evas_object_smart_changed(sd->layout);
}
+static Eina_Bool
+_accel_is_gl(void)
+{
+ if ((_elm_accel_preference) &&
+ ((!strcasecmp(_elm_accel_preference, "gl")) ||
+ (!strcasecmp(_elm_accel_preference, "opengl")) ||
+ (!strcasecmp(_elm_accel_preference, "3d")) ||
+ (!strcasecmp(_elm_accel_preference, "hw")) ||
+ (!strcasecmp(_elm_accel_preference, "accel")) ||
+ (!strcasecmp(_elm_accel_preference, "hardware")) ||
+ (!strcasecmp(_elm_accel_preference, "accel"))
+ ))
+ return EINA_TRUE;
+ return EINA_FALSE;
+}
+
static void
_win_constructor(Eo *obj, void *_pd, va_list *list)
{
@@ -2895,15 +2911,7 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
disp = getenv("ELM_DISPLAY");
if ((disp) && (!strcmp(disp, "x11")))
{
- if ((_elm_accel_preference) &&
- ((!strcasecmp(_elm_accel_preference, "gl")) ||
- (!strcasecmp(_elm_accel_preference, "opengl")) ||
- (!strcasecmp(_elm_accel_preference, "3d")) ||
- (!strcasecmp(_elm_accel_preference, "hw")) ||
- (!strcasecmp(_elm_accel_preference, "accel")) ||
- (!strcasecmp(_elm_accel_preference, "hardware")) ||
- (!strcasecmp(_elm_accel_preference, "accel"))
- ))
+ if (_accel_is_gl())
{
enginelist[0] = ELM_OPENGL_X11;
enginelist[1] = ELM_SOFTWARE_X11;
@@ -2919,15 +2927,7 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
}
else if ((disp) && (!strcmp(disp, "wl")))
{
- if ((_elm_accel_preference) &&
- ((!strcasecmp(_elm_accel_preference, "gl")) ||
- (!strcasecmp(_elm_accel_preference, "opengl")) ||
- (!strcasecmp(_elm_accel_preference, "3d")) ||
- (!strcasecmp(_elm_accel_preference, "hw")) ||
- (!strcasecmp(_elm_accel_preference, "accel")) ||
- (!strcasecmp(_elm_accel_preference, "hardware")) ||
- (!strcasecmp(_elm_accel_preference, "accel"))
- ))
+ if (_accel_is_gl())
{
enginelist[0] = ELM_WAYLAND_EGL;
enginelist[1] = ELM_WAYLAND_SHM;
@@ -2949,15 +2949,7 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
}
else if ((disp) && (!strcmp(disp, "sdl")))
{
- if ((_elm_accel_preference) &&
- ((!strcasecmp(_elm_accel_preference, "gl")) ||
- (!strcasecmp(_elm_accel_preference, "opengl")) ||
- (!strcasecmp(_elm_accel_preference, "3d")) ||
- (!strcasecmp(_elm_accel_preference, "hw")) ||
- (!strcasecmp(_elm_accel_preference, "accel")) ||
- (!strcasecmp(_elm_accel_preference, "hardware")) ||
- (!strcasecmp(_elm_accel_preference, "accel"))
- ))
+ if (_accel_is_gl())
{
enginelist[0] = ELM_OPENGL_SDL;
enginelist[1] = ELM_SOFTWARE_SDL;
@@ -3008,15 +3000,7 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
}
else
{
- if ((_elm_accel_preference) &&
- ((!strcasecmp(_elm_accel_preference, "gl")) ||
- (!strcasecmp(_elm_accel_preference, "opengl")) ||
- (!strcasecmp(_elm_accel_preference, "3d")) ||
- (!strcasecmp(_elm_accel_preference, "hw")) ||
- (!strcasecmp(_elm_accel_preference, "accel")) ||
- (!strcasecmp(_elm_accel_preference, "hardware")) ||
- (!strcasecmp(_elm_accel_preference, "accel"))
- ))
+ if (_accel_is_gl())
{
enginelist[0] = ELM_OPENGL_X11;
enginelist[1] = ELM_WAYLAND_EGL;