summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp
diff options
context:
space:
mode:
authorIlya Fedin <fedin-ilja2010@ya.ru>2023-03-24 17:41:24 +0400
committerIlya Fedin <fedin-ilja2010@ya.ru>2023-09-19 00:13:30 +0400
commit12d6fc5229196038af8d42cb0edec91766c1a1d4 (patch)
tree9f43531abb0729c5de0f1825dd0cc49b491932d9 /src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp
parent6f5136ef6661150046b64992fb78b23f02da0ef2 (diff)
xcb_egl: Prefer eglCreatePlatformWindowSurfaceEXT to eglCreateWindowSurface
Change-Id: I32de5b241cce786318434e7653ff979cf8e82f0e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp')
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp
index 2bff6b3950..bf2ceb96f4 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp
@@ -46,15 +46,19 @@ void QXcbEglWindow::create()
{
QXcbWindow::create();
+ // this is always true without egl_x11
+ if (m_glIntegration->usingPlatformDisplay()) {
+ auto createPlatformWindowSurface = reinterpret_cast<PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC>(
+ eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT"));
+ m_surface = createPlatformWindowSurface(m_glIntegration->eglDisplay(),
+ m_config,
+ reinterpret_cast<void *>(&m_window),
+ nullptr);
+ return;
+ }
+
#if QT_CONFIG(egl_x11)
m_surface = eglCreateWindowSurface(m_glIntegration->eglDisplay(), m_config, m_window, nullptr);
-#else
- auto createPlatformWindowSurface = reinterpret_cast<PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC>(
- eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT"));
- m_surface = createPlatformWindowSurface(m_glIntegration->eglDisplay(),
- m_config,
- reinterpret_cast<void *>(m_window),
- nullptr);
#endif
}