diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-11-29 10:42:56 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-11-29 12:21:19 +0000 |
commit | 09d75c6d8e83b3d0682e296357577988abae1b3f (patch) | |
tree | c5a55d4f1336a6764c4c6b67114ad9ff66115358 | |
parent | 545ef2e21d74128733f3b9b117d7c6024826cbb5 (diff) | |
download | qtwayland-09d75c6d8e83b3d0682e296357577988abae1b3f.tar.gz |
Fix crashing in non-core GLES functions on some systems
The 5.7 refactoring for QOpenGLFunctions introduced new requirements for the
QPlatformGLContext::getProcAddress implementations. Implementations outside of
qtbase were unfortunately forgotten. QtWayland's implementation does not derive
from the common EGL version so it needs its own patch.
Task-number: QTBUG-57326
Change-Id: Ie2ad22bf5986870aac74adc1e4c654c616091034
Reviewed-by: Risto Avila <risto.avila@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index f70c75a3..2a9e39ed 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -59,6 +59,8 @@ #include <QtCore/qmutex.h> +#include <dlfcn.h> + // Constants from EGL_KHR_create_context #ifndef EGL_CONTEXT_MINOR_VERSION_KHR #define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB @@ -575,9 +577,12 @@ bool QWaylandGLContext::isValid() const return m_context != EGL_NO_CONTEXT; } -void (*QWaylandGLContext::getProcAddress(const char *procName)) () +QFunctionPointer QWaylandGLContext::getProcAddress(const char *procName) { - return eglGetProcAddress(procName); + QFunctionPointer proc = (QFunctionPointer) eglGetProcAddress(procName); + if (!proc) + proc = (QFunctionPointer) dlsym(RTLD_DEFAULT, procName); + return proc; } EGLConfig QWaylandGLContext::eglConfig() const |