devilhorns pushed a commit to branch master.
commit 6f0a4a63bc8cd911f07fab6780874d47d7200cd1
Author: Chris Michael <[email protected]>
Date: Fri Apr 26 13:47:38 2013 +0100
Start on code to allow Wayland Clients to render using EGL
Currently, all Wayland Clients render inside E using software
(regardless of E's compositor setting).
Signed-off-by: Chris Michael <[email protected]>
---
src/bin/e_comp_wl.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 52 insertions(+), 5 deletions(-)
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 5a71c73..dc3eb50 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -146,7 +146,7 @@ e_comp_wl_init(void)
* NB: This is interesting....if we try to eglGetDisplay and pass in the
* wayland display, then EGL fails due to XCB not owning the event queue.
* If we pass it a NULL, it inits just fine */
- _e_wl_comp->egl.display = eglGetDisplay(NULL);
+ _e_wl_comp->egl.display =
eglGetDisplay((EGLNativeDisplayType)ecore_x_display_get());
if (_e_wl_comp->egl.display == EGL_NO_DISPLAY)
ERR("Could not get EGL display: %m");
else
@@ -169,6 +169,7 @@ e_comp_wl_init(void)
EGL_ALPHA_SIZE, 1, EGL_RENDERABLE_TYPE,
EGL_OPENGL_ES2_BIT, EGL_NONE
};
+ /* const char *exts; */
if ((!eglChooseConfig(_e_wl_comp->egl.display, attribs,
&_e_wl_comp->egl.config, 1, &n) || (n ==
0)))
@@ -176,6 +177,44 @@ e_comp_wl_init(void)
ERR("Could not choose EGL config: %m");
eglTerminate(_e_wl_comp->egl.display);
}
+
+ /* if (!eglBindAPI(EGL_OPENGL_ES_API)) */
+ /* { */
+ /* ERR("Could not bind EGL API: %m"); */
+ /* eglTerminate(_e_wl_comp->egl.display); */
+ /* } */
+
+ /* exts = (const char *)eglQueryString(_e_wl_comp->egl.display,
EGL_EXTENSIONS); */
+ /* if (!exts) */
+ /* { */
+ /* ERR("Could not get EGL Extensions: %m"); */
+ /* eglTerminate(_e_wl_comp->egl.display); */
+ /* } */
+ /* else */
+ /* { */
+ /* if (strstr(exts, "EGL_WL_bind_wayland_display")) */
+ /* { */
+ /* _e_wl_comp->egl.bind_display = */
+ /* (void
*)eglGetProcAddress("eglBindWaylandDisplayWL"); */
+ /* _e_wl_comp->egl.unbind_display = */
+ /* (void
*)eglGetProcAddress("eglUnbindWaylandDisplayWL"); */
+ /* } */
+ /* } */
+
+ /* if (_e_wl_comp->egl.bind_display) */
+ /* { */
+ /* EGLBoolean ret; */
+
+ /* ret =
_e_wl_comp->egl.bind_display(_e_wl_comp->egl.display, */
+ /*
_e_wl_comp->wl.display); */
+ /* if (!ret) */
+ /* { */
+ /* ERR("Could not bind EGL Wayland Display: %m"); */
+ /* _e_wl_comp->egl.bound = EINA_FALSE; */
+ /* } */
+ /* else */
+ /* _e_wl_comp->egl.bound = EINA_TRUE; */
+ /* } */
}
}
#endif
@@ -230,9 +269,13 @@ err:
if (_module_idler) ecore_idler_del(_module_idler);
#ifdef HAVE_WAYLAND_EGL
+ /* unbind wayland display */
+ if (_e_wl_comp->egl.bound)
+ _e_wl_comp->egl.unbind_display(_e_wl_comp->egl.display,
_e_wl_comp->wl.display);
+
/* terminate the egl display */
- if (_e_wl_comp->egl.display)
- eglTerminate(_e_wl_comp->egl.display);
+ if (_e_wl_comp->egl.display) eglTerminate(_e_wl_comp->egl.display);
+
eglReleaseThread();
#endif
@@ -262,9 +305,13 @@ e_comp_wl_shutdown(void)
_e_comp_wl_input_shutdown();
#ifdef HAVE_WAYLAND_EGL
+ /* unbind wayland display */
+ if (_e_wl_comp->egl.bound)
+ _e_wl_comp->egl.unbind_display(_e_wl_comp->egl.display,
_e_wl_comp->wl.display);
+
/* terminate the egl display */
- if (_e_wl_comp->egl.display)
- eglTerminate(_e_wl_comp->egl.display);
+ if (_e_wl_comp->egl.display) eglTerminate(_e_wl_comp->egl.display);
+
eglReleaseThread();
#endif
--
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr