From 5ca837bf42fd3bdb0cdf74bd10b6d1f63efa50a9 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 29 Nov 2016 11:41:19 +0100 Subject: Unify getProcAddress behavior in the brcm backend Task-number: QTBUG-57326 Change-Id: Ie3df866507e591b47e0e65a1867313b0ab388635 Reviewed-by: Lars Knoll --- src/hardwareintegration/client/brcm-egl/brcm-egl.pri | 2 ++ .../client/brcm-egl/qwaylandbrcmglcontext.cpp | 9 +++++++-- src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/hardwareintegration/client/brcm-egl/brcm-egl.pri b/src/hardwareintegration/client/brcm-egl/brcm-egl.pri index 64cb44677..3961f4f1e 100644 --- a/src/hardwareintegration/client/brcm-egl/brcm-egl.pri +++ b/src/hardwareintegration/client/brcm-egl/brcm-egl.pri @@ -3,6 +3,8 @@ INCLUDEPATH += $$PWD QMAKE_USE += egl wayland-client QT += egl_support-private +LIBS_PRIVATE += $$QMAKE_LIBS_DYNLOAD + SOURCES += $$PWD/qwaylandbrcmeglintegration.cpp \ $$PWD/qwaylandbrcmglcontext.cpp \ $$PWD/qwaylandbrcmeglwindow.cpp diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp index f5480b0ed..5c585746c 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp @@ -48,6 +48,8 @@ #include #include +#include + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -92,9 +94,12 @@ void QWaylandBrcmGLContext::swapBuffers(QPlatformSurface *surface) static_cast(surface)->swapBuffers(); } -void (*QWaylandBrcmGLContext::getProcAddress(const char *procName)) () +QFunctionPointer QWaylandBrcmGLContext::getProcAddress(const char *procName) { - return eglGetProcAddress(procName); + QFunctionPointer proc = (QFunctionPointer) eglGetProcAddress(procName); + if (!proc) + proc = (QFunctionPointer) dlsym(RTLD_DEFAULT, procName); + return proc; } EGLConfig QWaylandBrcmGLContext::eglConfig() const diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h index a79cfcc68..7a1475e71 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h @@ -63,7 +63,7 @@ public: bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE; void doneCurrent() Q_DECL_OVERRIDE; - void (*getProcAddress(const char *procName)) () Q_DECL_OVERRIDE; + QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE; QSurfaceFormat format() const Q_DECL_OVERRIDE { return m_format; } -- cgit v1.2.3