summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2016-02-02 12:50:33 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-03-01 14:46:26 +0000
commit5e9a5246fb688a33ff27bed010226595f579f23d (patch)
treebfa49687f2bb6a91d04605e42377d4fdbd54bf12 /src/plugins/platforms
parentc69622fc60db8a3dc6755eda4136d01456a3785c (diff)
Ensure we can query all GL functions in all platform plugins
This is required to simplify our code in the opengl classes and makes it possible to remove OS dependent code paths in Qt Gui. Change-Id: Ice09440840c86b2d6ac8d3955d273846695338d4 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/directfb/qdirectfbglcontext.cpp7
-rw-r--r--src/plugins/platforms/mirclient/qmirclientglcontext.cpp6
-rw-r--r--src/plugins/platforms/openwfd/qopenwfdglcontext.cpp6
3 files changed, 14 insertions, 5 deletions
diff --git a/src/plugins/platforms/directfb/qdirectfbglcontext.cpp b/src/plugins/platforms/directfb/qdirectfbglcontext.cpp
index e1607b131a..847435d96e 100644
--- a/src/plugins/platforms/directfb/qdirectfbglcontext.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbglcontext.cpp
@@ -40,6 +40,7 @@
#include "qdirectfbglcontext.h"
#include <directfbgl.h>
+#include <dlfcn.h>
#include <QDebug>
@@ -80,13 +81,13 @@ void QDirectFbGLContext::doneCurrent()
m_dfbGlContext->Unlock(m_dfbGlContext);
}
-void *QDirectFbGLContext::getProcAddress(const char *procName)
+QFunctionPointer QDirectFbGLContext::getProcAddress(const char *procName)
{
void *proc;
DFBResult result = m_dfbGlContext->GetProcAddress(m_dfbGlContext, procName, &proc);
if (result == DFB_OK)
- return proc;
- return 0;
+ return (QFunctionPointer) proc;
+ return dlsym(RTLD_DEFAULT, procName);
}
void QDirectFbGLContext::swapBuffers()
diff --git a/src/plugins/platforms/mirclient/qmirclientglcontext.cpp b/src/plugins/platforms/mirclient/qmirclientglcontext.cpp
index 7a288af6ff..b1ca0b1f7c 100644
--- a/src/plugins/platforms/mirclient/qmirclientglcontext.cpp
+++ b/src/plugins/platforms/mirclient/qmirclientglcontext.cpp
@@ -40,6 +40,7 @@
#include "qmirclientlogging.h"
#include <QtPlatformSupport/private/qeglconvenience_p.h>
#include <QtGui/private/qopenglcontext_p.h>
+#include <dlfcn.h>
#if !defined(QT_NO_DEBUG)
static void printOpenGLESConfig() {
@@ -150,5 +151,8 @@ QFunctionPointer QMirClientOpenGLContext::getProcAddress(const char *procName)
#else
ASSERT(eglBindAPI(api_in_use()) == EGL_TRUE);
#endif
- return eglGetProcAddress(procName);
+ QFunctionPointer proc = (QFunctionPointer) eglGetProcAddress(procName);
+ if (!proc)
+ proc = (QFunctionPointer) dlsym(RTLD_DEFAULT, procName);
+ return proc;
}
diff --git a/src/plugins/platforms/openwfd/qopenwfdglcontext.cpp b/src/plugins/platforms/openwfd/qopenwfdglcontext.cpp
index e57be90870..31d369ae00 100644
--- a/src/plugins/platforms/openwfd/qopenwfdglcontext.cpp
+++ b/src/plugins/platforms/openwfd/qopenwfdglcontext.cpp
@@ -41,6 +41,7 @@
#include "qopenwfdwindow.h"
#include "qopenwfdscreen.h"
+#include <dlfcn.h>
QOpenWFDGLContext::QOpenWFDGLContext(QOpenWFDDevice *device)
: QPlatformOpenGLContext()
@@ -86,7 +87,10 @@ void QOpenWFDGLContext::swapBuffers(QPlatformSurface *surface)
QFunctionPointer QOpenWFDGLContext::getProcAddress(const char *procName)
{
- return eglGetProcAddress(procName);
+ QFunctionPointer proc = (QFunctionPointer) eglGetProcAddress(procName);
+ if (!proc)
+ proc = (QFunctionPointer) dlsym(RTLD_DEFAULT, procName);
+ return proc;
}
EGLContext QOpenWFDGLContext::eglContext() const