summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/eglconvenience/qeglconvenience.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-11-26 22:30:27 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-11-26 22:35:48 +0100
commit4a8273a6fc2e741e811cf5dabc9a3c240306cf7f (patch)
tree2148abc88f8543eecdc0b97b2dd92594836af9b2 /src/platformsupport/eglconvenience/qeglconvenience.cpp
parent036c5db468164297d213764c59a4b59daa76d90a (diff)
parent1c2be58fecaff1de5f2849192eb712984ebd59bd (diff)
Merge remote-tracking branch 'origin/stable' into dev
For the conflicts in msvc_nmake.cpp the ifdefs are extended since we need to support windows phone in the target branch while it is not there in the current stable branch (as of Qt 5.2). Conflicts: configure qmake/generators/win32/msvc_nmake.cpp src/3rdparty/angle/src/libEGL/Surface.cpp src/angle/src/common/common.pri src/corelib/global/qglobal.h src/corelib/io/qstandardpaths.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxscreeneventhandler.h src/plugins/platforms/xcb/qglxintegration.h src/widgets/kernel/win.pri tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp tools/configure/configureapp.cpp Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglconvenience.cpp')
-rw-r--r--src/platformsupport/eglconvenience/qeglconvenience.cpp29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/platformsupport/eglconvenience/qeglconvenience.cpp b/src/platformsupport/eglconvenience/qeglconvenience.cpp
index 50baf6f06d..fe6ba2b215 100644
--- a/src/platformsupport/eglconvenience/qeglconvenience.cpp
+++ b/src/platformsupport/eglconvenience/qeglconvenience.cpp
@@ -232,17 +232,28 @@ EGLConfig QEglConfigChooser::chooseConfig()
configureAttributes.append(surfaceType());
configureAttributes.append(EGL_RENDERABLE_TYPE);
- if (m_format.renderableType() == QSurfaceFormat::OpenVG)
+ switch (m_format.renderableType()) {
+ case QSurfaceFormat::OpenVG:
configureAttributes.append(EGL_OPENVG_BIT);
+ break;
#ifdef EGL_VERSION_1_4
- else if (m_format.renderableType() == QSurfaceFormat::OpenGL)
+# if !defined(QT_OPENGL_ES_2)
+ case QSurfaceFormat::DefaultRenderableType:
+# endif
+ case QSurfaceFormat::OpenGL:
configureAttributes.append(EGL_OPENGL_BIT);
+ break;
#endif
- else if (m_format.majorVersion() == 1)
- configureAttributes.append(EGL_OPENGL_ES_BIT);
- else
+ case QSurfaceFormat::OpenGLES:
+ if (m_format.majorVersion() == 1) {
+ configureAttributes.append(EGL_OPENGL_ES_BIT);
+ break;
+ }
+ // fall through
+ default:
configureAttributes.append(EGL_OPENGL_ES2_BIT);
-
+ break;
+ }
configureAttributes.append(EGL_NONE);
EGLConfig cfg = 0;
@@ -336,7 +347,11 @@ 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 && (renderableType & EGL_OPENGL_BIT))
+ else if ((referenceFormat.renderableType() == QSurfaceFormat::OpenGL
+# if !defined(QT_OPENGL_ES_2)
+ || referenceFormat.renderableType() == QSurfaceFormat::DefaultRenderableType
+# endif
+ ) && (renderableType & EGL_OPENGL_BIT))
format.setRenderableType(QSurfaceFormat::OpenGL);
#endif
else