summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbwindow.cpp
diff options
context:
space:
mode:
authorJohn Lindgren <john.lindgren@aol.com>2015-08-29 15:21:43 -0400
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-10-14 14:11:14 +0000
commit5d5e0a4e976622bc3db8b1f7f70041ff71e45085 (patch)
treef70252297f551e6a804640312408700e3932c577 /src/plugins/platforms/xcb/qxcbwindow.cpp
parent715a8e6f4ed3f8fd5c6d98c88b6260e5c1dba428 (diff)
Avoid triggering OpenGL initialization for RasterSurface
Application that do not require OpenGL need a way to opt-out of GLX/EGL calls completely. The initialization can be expensive and what is more, some systems may not have functional GLX at all (some VMs are known to crash when trying to get FBConfigs for the window). QApplication already has AA_ForceRasterWidgets, which causes the use of plain RasterSurface everywhere instead of RasterGLSurface. Combined with a trivial check in the xcb backend to skip all the Xlib+GLX/EGL path, the attribute will allow apps to ensure that no GLX/EGL calls are ever made. This however implies a change in QWindowContainer: the embedded window must use the same initialization path as the parent otherwise we will end up with a BadMatch. QWindowContainer can do this transparently to the applications, unless the QWindow is already created. Change-Id: I846af7edb8b92b9836cdbd93c6a5eec5a6147a49 Task-number: QTBUG-46765 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index e7f5bbf0e9..bde8826792 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -389,7 +389,8 @@ void QXcbWindow::create()
resolveFormat();
#ifdef XCB_USE_XLIB
- if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) {
+ if (window()->surfaceType() != QSurface::RasterSurface
+ && QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) {
XVisualInfo *visualInfo = Q_NULLPTR;
if (connection()->hasDefaultVisualId())
visualInfo = CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(this);