aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-09 01:22:33 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-09 01:22:33 +0900
commit1fbdf7cae051dfeb5e9a6ae0478e7a5e136384f1 (patch)
treecdaa82d0841f2f9b52df2b4b3bc6b3787af9f53b /legacy/elementary/src/lib/elm_win.c
parentwin - improve window engine choosing code to be simpler and support display (diff)
downloadefl-1fbdf7cae051dfeb5e9a6ae0478e7a5e136384f1.tar.gz
win - add accel preference option to elm windows
@feature - this adds the ability to hint what engine acceleration to use that is specific per display system.
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c106
1 files changed, 87 insertions, 19 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index e53088e948..343282db7a 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -2886,17 +2886,49 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
disp = getenv("ELM_DISPLAY");
if ((disp) && (!strcmp(disp, "x11")))
{
- enginelist[0] = ENGINE_GET();
- enginelist[1] = ELM_SOFTWARE_X11;
- enginelist[2] = ELM_OPENGL_X11;
- enginelist[3] = NULL;
+ 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, "hardware")) ||
+ (!strcasecmp(_elm_accel_preference, "accel"))
+ ))
+ {
+ enginelist[0] = ELM_OPENGL_X11;
+ enginelist[1] = ELM_SOFTWARE_X11;
+ enginelist[2] = NULL;
+ }
+ else
+ {
+ enginelist[0] = ENGINE_GET();
+ enginelist[1] = ELM_SOFTWARE_X11;
+ enginelist[2] = ELM_OPENGL_X11;
+ enginelist[3] = NULL;
+ }
}
else if ((disp) && (!strcmp(disp, "wl")))
{
- enginelist[0] = ENGINE_GET();
- enginelist[1] = ELM_WAYLAND_SHM;
- enginelist[2] = ELM_WAYLAND_EGL;
- enginelist[3] = NULL;
+ 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, "hardware")) ||
+ (!strcasecmp(_elm_accel_preference, "accel"))
+ ))
+ {
+ enginelist[0] = ELM_WAYLAND_EGL;
+ enginelist[1] = ELM_WAYLAND_SHM;
+ enginelist[2] = NULL;
+ }
+ else
+ {
+ enginelist[0] = ENGINE_GET();
+ enginelist[1] = ELM_WAYLAND_SHM;
+ enginelist[2] = ELM_WAYLAND_EGL;
+ enginelist[3] = NULL;
+ }
}
else if ((disp) && (!strcmp(disp, "win")))
{
@@ -2906,10 +2938,26 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
}
else if ((disp) && (!strcmp(disp, "sdl")))
{
- enginelist[0] = ENGINE_GET();
- enginelist[1] = ELM_SOFTWARE_SDL;
- enginelist[2] = ELM_OPENGL_SDL;
- enginelist[3] = NULL;
+ 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, "hardware")) ||
+ (!strcasecmp(_elm_accel_preference, "accel"))
+ ))
+ {
+ enginelist[0] = ELM_OPENGL_SDL;
+ enginelist[1] = ELM_SOFTWARE_SDL;
+ enginelist[2] = NULL;
+ }
+ else
+ {
+ enginelist[0] = ENGINE_GET();
+ enginelist[1] = ELM_SOFTWARE_SDL;
+ enginelist[2] = ELM_OPENGL_SDL;
+ enginelist[3] = NULL;
+ }
}
else if ((disp) && (!strcmp(disp, "mac")))
{
@@ -2948,13 +2996,33 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
}
else
{
- enginelist[0] = ENGINE_GET();
- enginelist[1] = ELM_SOFTWARE_X11;
- enginelist[2] = ELM_WAYLAND_SHM;
- enginelist[3] = ELM_SOFTWARE_FB;
- enginelist[4] = ELM_OPENGL_COCOA;
- enginelist[5] = ELM_SOFTWARE_SDL;
- enginelist[6] = NULL;
+ 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, "hardware")) ||
+ (!strcasecmp(_elm_accel_preference, "accel"))
+ ))
+ {
+ enginelist[0] = ENGINE_GET();
+ enginelist[1] = ELM_OPENGL_X11;
+ enginelist[2] = ELM_WAYLAND_EGL;
+ enginelist[3] = ELM_SOFTWARE_FB;
+ enginelist[4] = ELM_OPENGL_COCOA;
+ enginelist[5] = ELM_OPENGL_SDL;
+ enginelist[6] = NULL;
+ }
+ else
+ {
+ enginelist[0] = ENGINE_GET();
+ enginelist[1] = ELM_SOFTWARE_X11;
+ enginelist[2] = ELM_WAYLAND_SHM;
+ enginelist[3] = ELM_SOFTWARE_FB;
+ enginelist[4] = ELM_OPENGL_COCOA;
+ enginelist[5] = ELM_SOFTWARE_SDL;
+ enginelist[6] = NULL;
+ }
}
for (i = 0; i < 30; i++)
{