summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-10-17 11:02:54 +0200
committerLiang Qi <liang.qi@qt.io>2016-10-17 11:02:54 +0200
commitd90b155c6034bc16a9eb2d5794f101cde4ea9e2c (patch)
treee648b8db6b9e8e8d7f0c765ac2953b066524eb49 /src/gui
parentb00565bc2803bb783e8f2b0d02becfa73323e283 (diff)
parentd71bb504a635b51a85f3ccd919e0d77f869e50a8 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: mkspecs/macx-ios-clang/features/resolve_config.prf src/testlib/qtestcase.qdoc Change-Id: Icefa63056ffb37106f35299a8f19165535571799
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qsurfaceformat.cpp8
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp
index d7dc0faceb..dd742b6007 100644
--- a/src/gui/kernel/qsurfaceformat.cpp
+++ b/src/gui/kernel/qsurfaceformat.cpp
@@ -41,6 +41,7 @@
#include <QtCore/qatomic.h>
#include <QtCore/QDebug>
+#include <QOpenGLContext>
#ifdef major
#undef major
@@ -761,6 +762,13 @@ Q_GLOBAL_STATIC(QSurfaceFormat, qt_default_surface_format)
*/
void QSurfaceFormat::setDefaultFormat(const QSurfaceFormat &format)
{
+#ifndef QT_NO_OPENGL
+ QOpenGLContext *globalContext = QOpenGLContext::globalShareContext();
+ if (globalContext && globalContext->isValid()) {
+ qWarning("Warning: Setting a new default format with a different version or profile after "
+ "the global shared context is created may cause issues with context sharing.");
+ }
+#endif
*qt_default_surface_format() = format;
}
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index 14581c89f6..d9d4288ec8 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -1497,6 +1497,7 @@ bool QOpenGLFramebufferObject::bindDefault()
if (ctx) {
ctx->functions()->glBindFramebuffer(GL_FRAMEBUFFER, ctx->defaultFramebufferObject());
QOpenGLContextPrivate::get(ctx)->qgl_current_fbo_invalid = true;
+ QOpenGLContextPrivate::get(ctx)->qgl_current_fbo = Q_NULLPTR;
}
#ifdef QT_DEBUG
else