diff options
author | Paul Olav Tvete <paul.tvete@digia.com> | 2013-12-18 14:48:22 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-12 20:12:17 +0100 |
commit | eacd58d4e78e7238ba5fcca90ba960aaf3ebd263 (patch) | |
tree | 779bf1735aecb7985bc3136264b9147eb23d5374 /src/plugins/platforms/xcb/qxcbwindow.cpp | |
parent | 5ae5bebb93ec38e17c0dcb9bec47e0ebfbce4937 (diff) |
Enabling QQuickWidget and QOpenGLWidget
Enable child widgets (without a native window) that render to an FBO
and are composed with the raster backingstore by the platform plugin.
A preliminary version of QOpenGLWidget is included as private API.
Change-Id: I8f984a4d7db285069ce3d6564707942c823d890d
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 58abc7abfe..d0106984a2 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -292,8 +292,6 @@ void QXcbWindow::create() if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) { #if defined(XCB_USE_GLX) XVisualInfo *visualInfo = qglx_findVisualInfo(DISPLAY_FROM_XCB(m_screen), m_screen->screenNumber(), &m_format); - if (!visualInfo && window()->surfaceType() == QSurface::OpenGLSurface) - qFatal("Could not initialize GLX"); #elif defined(XCB_USE_EGL) EGLDisplay eglDisplay = connection()->egl_display(); EGLConfig eglConfig = q_configFromGLFormat(eglDisplay, m_format, true); @@ -308,9 +306,14 @@ void QXcbWindow::create() XVisualInfo *visualInfo; int matchingCount = 0; visualInfo = XGetVisualInfo(DISPLAY_FROM_XCB(this), VisualIDMask, &visualInfoTemplate, &matchingCount); - if (!visualInfo && window()->surfaceType() == QSurface::OpenGLSurface) - qFatal("Could not initialize EGL"); #endif //XCB_USE_GLX + if (!visualInfo && window()->surfaceType() == QSurface::OpenGLSurface) + qFatal("Could not initialize OpenGL"); + + if (!visualInfo && window()->surfaceType() == QSurface::RasterGLSurface) { + qWarning("Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface."); + window()->setSurfaceType(QSurface::RasterSurface); + } if (visualInfo) { m_depth = visualInfo->depth; m_imageFormat = imageFormatForDepth(m_depth); |