diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-23 12:41:28 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-23 13:07:52 (GMT) |
commit | 2905f11e8e8fe7e05d61cec9fcc1d78ff91f0f31 (patch) | |
tree | b6f17ae6df26f14496dbdeb2cc35ba3c76444935 /src/plugins/platforms/xlib/qxlibintegration.cpp | |
parent | 9f6eb99448d3ee8cbdd1c5b41903176759b1664f (diff) | |
download | Qt-2905f11e8e8fe7e05d61cec9fcc1d78ff91f0f31.zip Qt-2905f11e8e8fe7e05d61cec9fcc1d78ff91f0f31.tar.gz Qt-2905f11e8e8fe7e05d61cec9fcc1d78ff91f0f31.tar.bz2 |
Avoid duplicate calls to eglGetDisplay() in XCB / Xlib platforms.
Just call eglGetDisplay() once, as we also need to call eglInitialize()
before the display can be used validly.
Diffstat (limited to 'src/plugins/platforms/xlib/qxlibintegration.cpp')
-rw-r--r-- | src/plugins/platforms/xlib/qxlibintegration.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/xlib/qxlibintegration.cpp b/src/plugins/platforms/xlib/qxlibintegration.cpp index 6733ed1..63197b0 100644 --- a/src/plugins/platforms/xlib/qxlibintegration.cpp +++ b/src/plugins/platforms/xlib/qxlibintegration.cpp @@ -141,11 +141,12 @@ bool QXlibIntegration::hasOpenGL() const static bool wasEglInitialized = false; if (!eglHasbeenInitialized) { eglHasbeenInitialized = true; - const QXlibScreen *screen = static_cast<const QXlibScreen *>(mScreens.at(0)); + QXlibScreen *screen = static_cast<QXlibScreen *>(mScreens.at(0)); EGLint major, minor; eglBindAPI(EGL_OPENGL_ES_API); EGLDisplay disp = eglGetDisplay(screen->display()->nativeDisplay()); wasEglInitialized = eglInitialize(disp,&major,&minor); + screen->setEglDisplay(disp); } return wasEglInitialized; #endif |