summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/gl_integrations/xcb_glx
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-03-20 08:44:28 +0100
committerLiang Qi <liang.qi@qt.io>2017-03-20 09:00:44 +0100
commitae2695535a2f1abbd4c6596a22dd33319b9388dd (patch)
tree91df41df365a13ea71b1361d909535e5b7a7360a /src/plugins/platforms/xcb/gl_integrations/xcb_glx
parent8066ae49433ed7604e710eef7b15d15de171608e (diff)
parentc1a2f97a3b3a8c058b1760b57e5c83bf7815b84a (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/corelib/io/qfilesystemengine_win.cpp src/gui/text/qdistancefield.cpp src/plugins/platforms/xcb/qxcbconnection.h Change-Id: I1be4a6f440ccb7599991159e3cb9de60990e4b1e
Diffstat (limited to 'src/plugins/platforms/xcb/gl_integrations/xcb_glx')
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp24
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro2
2 files changed, 22 insertions, 4 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
index 492fbf7e10..d9add22e00 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
@@ -38,7 +38,9 @@
****************************************************************************/
#include <QDebug>
+#if QT_CONFIG(library)
#include <QLibrary>
+#endif
#include "qxcbwindow.h"
#include "qxcbscreen.h"
@@ -54,7 +56,9 @@
#include <QtGlxSupport/private/qglxconvenience_p.h>
#include <QtPlatformHeaders/QGLXNativeContext>
-#if defined(Q_OS_LINUX) || defined(Q_OS_BSD4)
+#include "qxcbglintegration.h"
+
+#if !defined(QT_STATIC) && QT_CONFIG(dlopen)
#include <dlfcn.h>
#endif
@@ -564,7 +568,7 @@ QFunctionPointer QGLXContext::getProcAddress(const char *procName)
if (!glXGetProcAddressARB) {
QList<QByteArray> glxExt = QByteArray(glXGetClientString(m_display, GLX_EXTENSIONS)).split(' ');
if (glxExt.contains("GLX_ARB_get_proc_address")) {
-#if defined(Q_OS_LINUX) || defined(Q_OS_BSD4)
+#if QT_CONFIG(dlopen)
void *handle = dlopen(NULL, RTLD_LAZY);
if (handle) {
glXGetProcAddressARB = (qt_glXGetProcAddressARB) dlsym(handle, "glXGetProcAddressARB");
@@ -573,7 +577,7 @@ QFunctionPointer QGLXContext::getProcAddress(const char *procName)
if (!glXGetProcAddressARB)
#endif
{
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
extern const QString qt_gl_library_name();
// QLibrary lib(qt_gl_library_name());
QLibrary lib(QLatin1String("GL"));
@@ -689,6 +693,10 @@ void QGLXContext::queryDummyContext()
if (const char *renderer = (const char *) glGetString(GL_RENDERER)) {
for (int i = 0; qglx_threadedgl_blacklist_renderer[i]; ++i) {
if (strstr(renderer, qglx_threadedgl_blacklist_renderer[i]) != 0) {
+ qCInfo(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: "
+ "blacklisted renderer \""
+ << qglx_threadedgl_blacklist_renderer[i]
+ << "\"";
m_supportsThreading = false;
break;
}
@@ -698,6 +706,11 @@ void QGLXContext::queryDummyContext()
if (glxvendor) {
for (int i = 0; qglx_threadedgl_blacklist_vendor[i]; ++i) {
if (strstr(glxvendor, qglx_threadedgl_blacklist_vendor[i]) != 0) {
+ qCInfo(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: "
+ "blacklisted vendor \""
+ << qglx_threadedgl_blacklist_vendor[i]
+ << "\"";
+
m_supportsThreading = false;
break;
}
@@ -707,6 +720,11 @@ void QGLXContext::queryDummyContext()
context.doneCurrent();
if (oldContext && oldSurface)
oldContext->makeCurrent(oldSurface);
+
+ if (!m_supportsThreading) {
+ qCInfo(lcQpaGl) << "Force-enable multithreaded OpenGL by setting "
+ "environment variable QT_OPENGL_NO_SANITY_CHECK";
+ }
}
bool QGLXContext::supportsThreading()
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro
index 8aa6e1febd..215f5a3fe1 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro
@@ -12,7 +12,7 @@ qtConfig(xcb-glx) {
QMAKE_USE += xcb_glx
}
-LIBS += $$QMAKE_LIBS_DYNLOAD
+!static:qtConfig(dlopen): QMAKE_USE += libdl
HEADERS += \
qxcbglxintegration.h \