summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-09-20 10:11:46 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-09-20 10:47:23 +0100
commit17e375c5a7600c76e02efdec3e96c3edf5d27bbb (patch)
treee197b5c7cb74df0c2d22087614c3f88ca630db28 /src/modules
parent822680869ff70a0f69dd383e3a810f3f18462dbc (diff)
wizard - comp - fix checking of gl/hw accel
using just evas_gl_new() will lead to almost always using just software rendering... because often osmesa is not installed and e will start in software rendering by default until it switches properly after the wizard. this appropriately checks in an x path vs. wayland path in different ways as to if we should do gl by default and ALWAYS offers a checkbox to the user, just the default value/state of that checkbox depends on what is detected and a user can override.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/wizard/page_150.c43
1 files changed, 41 insertions, 2 deletions
diff --git a/src/modules/wizard/page_150.c b/src/modules/wizard/page_150.c
index 1a2a0f4..253e928 100644
--- a/src/modules/wizard/page_150.c
+++ b/src/modules/wizard/page_150.c
@@ -6,6 +6,7 @@
6static Eina_Bool do_gl = 0; 6static Eina_Bool do_gl = 0;
7static Eina_Bool do_vsync = 0; 7static Eina_Bool do_vsync = 0;
8 8
9
9static void 10static void
10check_add(Evas_Object *box, const char *txt, Eina_Bool *val) 11check_add(Evas_Object *box, const char *txt, Eina_Bool *val)
11{ 12{
@@ -22,7 +23,7 @@ check_add(Evas_Object *box, const char *txt, Eina_Bool *val)
22E_API int 23E_API int
23wizard_page_show(E_Wizard_Page *pg EINA_UNUSED) 24wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
24{ 25{
25 Evas_Object *o, *of, *ob; 26 Evas_Object *o, *of;
26 27
27 api->wizard_title_set(_("Compositing")); 28 api->wizard_title_set(_("Compositing"));
28 29
@@ -47,8 +48,46 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
47 evas_gl_free(gl); 48 evas_gl_free(gl);
48 } 49 }
49 } 50 }
51 if (!do_gl)
52 {
53#ifdef HAVE_WAYLAND
54 if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
55 {
56 if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_DRM))
57 {
58 void *egl = dlopen("libEGL.so.1", RTLD_NOW | RTLD_LOCAL);
59 if (!egl) egl = dlopen("libEGL.so", RTLD_NOW | RTLD_LOCAL);
60 if (egl)
61 {
62 do_gl = 1;
63 dlclose(egl);
64 }
65 }
66 do_vsync = 1;
67 }
68#endif
69#ifndef HAVE_WAYLAND_ONLY
70 if (e_comp->comp_type == E_PIXMAP_TYPE_X)
71 {
72 Ecore_X_Window_Attributes att;
73
74 memset((&att), 0, sizeof(Ecore_X_Window_Attributes));
75 ecore_x_window_attributes_get(ecore_x_window_root_first_get(), &att);
76 if ((att.depth > 8) &&
77 (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_X11)))
78 {
79 Ecore_Evas *ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 32, 32);
80 if (ee)
81 {
82 do_gl = do_vsync = 1;
83 ecore_evas_free(ee);
84 }
85 }
86 }
87 }
88#endif
50 check_add(o, _("Hardware Accelerated (OpenGL)"), &do_gl); 89 check_add(o, _("Hardware Accelerated (OpenGL)"), &do_gl);
51 check_add(o, _("Tear-free Rendering (OpenGL only)"), &do_vsync); 90 check_add(o, _("Tear-free Rendering"), &do_vsync);
52 91
53 evas_object_show(of); 92 evas_object_show(of);
54 api->wizard_page_show(of); 93 api->wizard_page_show(of);