summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-10-02 15:04:15 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2015-10-02 17:24:58 +0000
commit925d6eff3e8e5bc801210a67ec4cf1d4b3492fc2 (patch)
treea03f381e4823e29b2e50c1a80588f06e450656fc /src/platformsupport/eglconvenience/qeglplatformcontext.cpp
parenta3292031295a09e5e959141db78c2310e08562ae (diff)
parentd0eaa737e10aed34c09ba753e21c3e027b5ce58c (diff)
Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglplatformcontext.cpp')
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
index 905f7695bb..2de7fb3b40 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
@@ -39,6 +39,10 @@
#include <QtPlatformHeaders/QEGLNativeContext>
#include <QDebug>
+#ifdef Q_OS_ANDROID
+#include <QtCore/private/qjnihelpers_p.h>
+#endif
+
QT_BEGIN_NAMESPACE
/*!
@@ -305,6 +309,14 @@ void QEGLPlatformContext::updateFormatFromGL()
QByteArray version = QByteArray(reinterpret_cast<const char *>(s));
int major, minor;
if (QPlatformOpenGLContext::parseOpenGLVersion(version, major, minor)) {
+#ifdef Q_OS_ANDROID
+ // Some Android 4.2.2 devices report OpenGL ES 3.0 without the functions being available.
+ static int apiLevel = QtAndroidPrivate::androidSdkVersion();
+ if (apiLevel <= 17 && major >= 3) {
+ major = 2;
+ minor = 0;
+ }
+#endif
m_format.setMajorVersion(major);
m_format.setMinorVersion(minor);
}