summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/eglconvenience/eglconvenience.pri11
-rw-r--r--src/platformsupport/eglconvenience/qeglconvenience.cpp23
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext.cpp8
3 files changed, 31 insertions, 11 deletions
diff --git a/src/platformsupport/eglconvenience/eglconvenience.pri b/src/platformsupport/eglconvenience/eglconvenience.pri
index 6da0ea4fd1..c026ff5a4b 100644
--- a/src/platformsupport/eglconvenience/eglconvenience.pri
+++ b/src/platformsupport/eglconvenience/eglconvenience.pri
@@ -37,4 +37,15 @@ contains(QT_CONFIG,egl) {
$$PWD/qxlibeglintegration.cpp
}
CONFIG += egl
+
+} else: contains(QT_CONFIG,dynamicgl) {
+ HEADERS += \
+ $$PWD/qeglconvenience_p.h \
+ $$PWD/qeglplatformcontext_p.h \
+ $$PWD/qeglpbuffer_p.h
+
+ SOURCES += \
+ $$PWD/qeglconvenience.cpp \
+ $$PWD/qeglplatformcontext.cpp \
+ $$PWD/qeglpbuffer.cpp
}
diff --git a/src/platformsupport/eglconvenience/qeglconvenience.cpp b/src/platformsupport/eglconvenience/qeglconvenience.cpp
index e561a6bc55..a36d0b83d4 100644
--- a/src/platformsupport/eglconvenience/qeglconvenience.cpp
+++ b/src/platformsupport/eglconvenience/qeglconvenience.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include <QByteArray>
+#include <QOpenGLFunctions>
#ifdef Q_OS_LINUX
#include <sys/ioctl.h>
@@ -243,12 +244,15 @@ EGLConfig QEglConfigChooser::chooseConfig()
configureAttributes.append(EGL_OPENVG_BIT);
break;
#ifdef EGL_VERSION_1_4
-# if !defined(QT_OPENGL_ES_2)
case QSurfaceFormat::DefaultRenderableType:
-# endif
- case QSurfaceFormat::OpenGL:
- configureAttributes.append(EGL_OPENGL_BIT);
+ if (!QOpenGLFunctions::isES())
+ configureAttributes.append(EGL_OPENGL_BIT);
+ else
+ configureAttributes.append(EGL_OPENGL_ES2_BIT);
break;
+ case QSurfaceFormat::OpenGL:
+ configureAttributes.append(EGL_OPENGL_BIT);
+ break;
#endif
case QSurfaceFormat::OpenGLES:
if (m_format.majorVersion() == 1) {
@@ -353,11 +357,12 @@ QSurfaceFormat q_glFormatFromConfig(EGLDisplay display, const EGLConfig config,
if (referenceFormat.renderableType() == QSurfaceFormat::OpenVG && (renderableType & EGL_OPENVG_BIT))
format.setRenderableType(QSurfaceFormat::OpenVG);
#ifdef EGL_VERSION_1_4
- else if ((referenceFormat.renderableType() == QSurfaceFormat::OpenGL
-# if !defined(QT_OPENGL_ES_2)
- || referenceFormat.renderableType() == QSurfaceFormat::DefaultRenderableType
-# endif
- ) && (renderableType & EGL_OPENGL_BIT))
+ else if (referenceFormat.renderableType() == QSurfaceFormat::OpenGL
+ && (renderableType & EGL_OPENGL_BIT))
+ format.setRenderableType(QSurfaceFormat::OpenGL);
+ else if (referenceFormat.renderableType() == QSurfaceFormat::DefaultRenderableType
+ && !QOpenGLFunctions::isES()
+ && (renderableType & EGL_OPENGL_BIT))
format.setRenderableType(QSurfaceFormat::OpenGL);
#endif
else
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
index 37875b1e2b..3a34748fc7 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
@@ -42,6 +42,7 @@
#include "qeglplatformcontext_p.h"
#include "qeglconvenience_p.h"
#include <qpa/qplatformwindow.h>
+#include <QtGui/QOpenGLFunctions>
QT_BEGIN_NAMESPACE
@@ -69,9 +70,12 @@ static inline void bindApi(const QSurfaceFormat &format)
eglBindAPI(EGL_OPENVG_API);
break;
#ifdef EGL_VERSION_1_4
-# if !defined(QT_OPENGL_ES_2)
case QSurfaceFormat::DefaultRenderableType:
-# endif
+ if (!QOpenGLFunctions::isES())
+ eglBindAPI(EGL_OPENGL_API);
+ else
+ eglBindAPI(EGL_OPENGL_ES_API);
+ break;
case QSurfaceFormat::OpenGL:
eglBindAPI(EGL_OPENGL_API);
break;