diff options
author | Ilya Fedin <fedin-ilja2010@ya.ru> | 2021-10-05 04:31:47 +0400 |
---|---|---|
committer | Ilya Fedin <fedin-ilja2010@ya.ru> | 2021-10-06 15:34:17 +0400 |
commit | 816c5de460439faac0745cb364c374162b7fc651 (patch) | |
tree | 64a67e1a980cdad5f26436d245257659ee1e9679 | |
parent | 82b86960c051de99fca7c4dfa7af2c914937f5c8 (diff) |
Add support for EGL_EXT_platform_xcb
This allows to create EGL context without involving Xlib.
This extension was created a year ago and is present in Mesa since 21.0
Change-Id: Id9bcbffe8c46cb00d9cc0a9a425c1706d1b52b28
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/gui/opengl/platform/egl/qeglstreamconvenience_p.h | 4 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/opengl/platform/egl/qeglstreamconvenience_p.h b/src/gui/opengl/platform/egl/qeglstreamconvenience_p.h index 22e124b279..a03f0ff1f0 100644 --- a/src/gui/opengl/platform/egl/qeglstreamconvenience_p.h +++ b/src/gui/opengl/platform/egl/qeglstreamconvenience_p.h @@ -149,6 +149,10 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay #define EGL_PLATFORM_X11_KHR 0x31D5 #endif +#ifndef EGL_PLATFORM_XCB_KHR +#define EGL_PLATFORM_XCB_KHR 0x31DC +#endif + #ifndef EGL_NV_stream_attrib typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMATTRIBNVPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSTREAMATTRIBNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value); diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp index f3630d57b9..5f07b10f04 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp @@ -67,7 +67,12 @@ bool QXcbEglIntegration::initialize(QXcbConnection *connection) const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); - if (extensions && strstr(extensions, "EGL_EXT_platform_x11")) { + if (extensions && (strstr(extensions, "EGL_EXT_platform_xcb") || strstr(extensions, "EGL_MESA_platform_xcb"))) { + QEGLStreamConvenience streamFuncs; + m_egl_display = streamFuncs.get_platform_display(EGL_PLATFORM_XCB_KHR, + reinterpret_cast<void *>(connection->xcb_connection()), + nullptr); + } else if (extensions && strstr(extensions, "EGL_EXT_platform_x11")) { QEGLStreamConvenience streamFuncs; m_egl_display = streamFuncs.get_platform_display(EGL_PLATFORM_X11_KHR, xlib_display(), |