diff options
author | Andrew Knight <andrew.knight@digia.com> | 2013-12-02 11:15:31 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-03 20:02:45 +0100 |
commit | 28d77c24c2deec2eee8c735b299f0da792d75c9f (patch) | |
tree | b8897fb4d80d6ba42e901c0c0cb7d396a0a80b53 /src | |
parent | fcfb62626bc2d3e7b19c58555457c6319d3e85ca (diff) |
xcb qpa: initialize EGL for non-XLib builds
Move the EGL initialization code outside of the XLib ifdefs, so it
can be enabled for non-XLib builds as well
Change-Id: Ie025551e4e99bb0b365f025356bd9725f4283b82
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 4d2735ca85..c00b4d551b 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -274,21 +274,22 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra XSetEventQueueOwner(dpy, XCBOwnsEventQueue); XSetErrorHandler(nullErrorHandler); m_xlib_display = dpy; -#ifdef XCB_USE_EGL - EGLDisplay eglDisplay = eglGetDisplay(dpy); - m_egl_display = eglDisplay; - EGLint major, minor; - eglBindAPI(EGL_OPENGL_ES_API); - m_has_egl = eglInitialize(eglDisplay,&major,&minor); -#endif //XCB_USE_EGL } #else + EGLNativeDisplayType dpy = EGL_DEFAULT_DISPLAY; m_connection = xcb_connect(m_displayName.constData(), &m_primaryScreen); #endif //XCB_USE_XLIB if (!m_connection || xcb_connection_has_error(m_connection)) qFatal("QXcbConnection: Could not connect to display %s", m_displayName.constData()); +#ifdef XCB_USE_EGL + EGLDisplay eglDisplay = eglGetDisplay(dpy); + m_egl_display = eglDisplay; + EGLint major, minor; + m_has_egl = eglInitialize(eglDisplay, &major, &minor); +#endif //XCB_USE_EGL + m_reader = new QXcbEventReader(this); m_reader->start(); |