xcb: make it possible to disable gl integrations

By setting QT_XCB_GL_INTEGRATION to the special value "none", no plugins
will be considered for loading. This matches what eglfs does with
QT_QPA_EGLFS_INTEGRATION.

This allows widget or raster-QWindow-only apps to start up faster by not
spending time on plugin loading and potential initialization steps there.

Task-number: QTBUG-46765
Change-Id: Ifeec3548a9b58f619a18e0be75fe4a9f489677a9
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
This commit is contained in:
Laszlo Agocs 2015-06-19 10:34:24 +02:00
parent 03fd8fa463
commit 52c35c1ce7

View File

@ -532,9 +532,14 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
QStringList glIntegrationNames;
glIntegrationNames << QStringLiteral("xcb_glx") << QStringLiteral("xcb_egl");
QString glIntegrationName = QString::fromLocal8Bit(qgetenv("QT_XCB_GL_INTEGRATION"));
if (glIntegrationName.size()) {
if (!glIntegrationName.isEmpty()) {
qCDebug(QT_XCB_GLINTEGRATION) << "QT_XCB_GL_INTEGRATION is set to" << glIntegrationName;
if (glIntegrationName != QStringLiteral("none")) {
glIntegrationNames.removeAll(glIntegrationName);
glIntegrationNames.prepend(glIntegrationName);
} else {
glIntegrationNames.clear();
}
}
qCDebug(QT_XCB_GLINTEGRATION) << "Choosing xcb gl-integration based on following priority\n" << glIntegrationNames;