summaryrefslogtreecommitdiff
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
commit0992d05e77d8a6184621f0baebbae705d3ff6e99 (patch)
treedd32b10947631a3afa8e10ed61ab48b56356f669
parentfda28bfcfd1ab4b56f75173a926256934eed3942 (diff)
win - reduce code duplication and move accel prefernce into single func
-rw-r--r--src/lib/elm_win.c56
1 files changed, 20 insertions, 36 deletions
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 6c0bf7b72..45682f08e 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -2842,6 +2842,22 @@ _window_layout_stack(Evas_Object *o, Evas_Object_Box_Data *p, void *data)
2842 evas_object_smart_changed(sd->layout); 2842 evas_object_smart_changed(sd->layout);
2843} 2843}
2844 2844
2845static Eina_Bool
2846_accel_is_gl(void)
2847{
2848 if ((_elm_accel_preference) &&
2849 ((!strcasecmp(_elm_accel_preference, "gl")) ||
2850 (!strcasecmp(_elm_accel_preference, "opengl")) ||
2851 (!strcasecmp(_elm_accel_preference, "3d")) ||
2852 (!strcasecmp(_elm_accel_preference, "hw")) ||
2853 (!strcasecmp(_elm_accel_preference, "accel")) ||
2854 (!strcasecmp(_elm_accel_preference, "hardware")) ||
2855 (!strcasecmp(_elm_accel_preference, "accel"))
2856 ))
2857 return EINA_TRUE;
2858 return EINA_FALSE;
2859}
2860
2845static void 2861static void
2846_win_constructor(Eo *obj, void *_pd, va_list *list) 2862_win_constructor(Eo *obj, void *_pd, va_list *list)
2847{ 2863{
@@ -2895,15 +2911,7 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
2895 disp = getenv("ELM_DISPLAY"); 2911 disp = getenv("ELM_DISPLAY");
2896 if ((disp) && (!strcmp(disp, "x11"))) 2912 if ((disp) && (!strcmp(disp, "x11")))
2897 { 2913 {
2898 if ((_elm_accel_preference) && 2914 if (_accel_is_gl())
2899 ((!strcasecmp(_elm_accel_preference, "gl")) ||
2900 (!strcasecmp(_elm_accel_preference, "opengl")) ||
2901 (!strcasecmp(_elm_accel_preference, "3d")) ||
2902 (!strcasecmp(_elm_accel_preference, "hw")) ||
2903 (!strcasecmp(_elm_accel_preference, "accel")) ||
2904 (!strcasecmp(_elm_accel_preference, "hardware")) ||
2905 (!strcasecmp(_elm_accel_preference, "accel"))
2906 ))
2907 { 2915 {
2908 enginelist[0] = ELM_OPENGL_X11; 2916 enginelist[0] = ELM_OPENGL_X11;
2909 enginelist[1] = ELM_SOFTWARE_X11; 2917 enginelist[1] = ELM_SOFTWARE_X11;
@@ -2919,15 +2927,7 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
2919 } 2927 }
2920 else if ((disp) && (!strcmp(disp, "wl"))) 2928 else if ((disp) && (!strcmp(disp, "wl")))
2921 { 2929 {
2922 if ((_elm_accel_preference) && 2930 if (_accel_is_gl())
2923 ((!strcasecmp(_elm_accel_preference, "gl")) ||
2924 (!strcasecmp(_elm_accel_preference, "opengl")) ||
2925 (!strcasecmp(_elm_accel_preference, "3d")) ||
2926 (!strcasecmp(_elm_accel_preference, "hw")) ||
2927 (!strcasecmp(_elm_accel_preference, "accel")) ||
2928 (!strcasecmp(_elm_accel_preference, "hardware")) ||
2929 (!strcasecmp(_elm_accel_preference, "accel"))
2930 ))
2931 { 2931 {
2932 enginelist[0] = ELM_WAYLAND_EGL; 2932 enginelist[0] = ELM_WAYLAND_EGL;
2933 enginelist[1] = ELM_WAYLAND_SHM; 2933 enginelist[1] = ELM_WAYLAND_SHM;
@@ -2949,15 +2949,7 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
2949 } 2949 }
2950 else if ((disp) && (!strcmp(disp, "sdl"))) 2950 else if ((disp) && (!strcmp(disp, "sdl")))
2951 { 2951 {
2952 if ((_elm_accel_preference) && 2952 if (_accel_is_gl())
2953 ((!strcasecmp(_elm_accel_preference, "gl")) ||
2954 (!strcasecmp(_elm_accel_preference, "opengl")) ||
2955 (!strcasecmp(_elm_accel_preference, "3d")) ||
2956 (!strcasecmp(_elm_accel_preference, "hw")) ||
2957 (!strcasecmp(_elm_accel_preference, "accel")) ||
2958 (!strcasecmp(_elm_accel_preference, "hardware")) ||
2959 (!strcasecmp(_elm_accel_preference, "accel"))
2960 ))
2961 { 2953 {
2962 enginelist[0] = ELM_OPENGL_SDL; 2954 enginelist[0] = ELM_OPENGL_SDL;
2963 enginelist[1] = ELM_SOFTWARE_SDL; 2955 enginelist[1] = ELM_SOFTWARE_SDL;
@@ -3008,15 +3000,7 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
3008 } 3000 }
3009 else 3001 else
3010 { 3002 {
3011 if ((_elm_accel_preference) && 3003 if (_accel_is_gl())
3012 ((!strcasecmp(_elm_accel_preference, "gl")) ||
3013 (!strcasecmp(_elm_accel_preference, "opengl")) ||
3014 (!strcasecmp(_elm_accel_preference, "3d")) ||
3015 (!strcasecmp(_elm_accel_preference, "hw")) ||
3016 (!strcasecmp(_elm_accel_preference, "accel")) ||
3017 (!strcasecmp(_elm_accel_preference, "hardware")) ||
3018 (!strcasecmp(_elm_accel_preference, "accel"))
3019 ))
3020 { 3004 {
3021 enginelist[0] = ELM_OPENGL_X11; 3005 enginelist[0] = ELM_OPENGL_X11;
3022 enginelist[1] = ELM_WAYLAND_EGL; 3006 enginelist[1] = ELM_WAYLAND_EGL;