aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2013-03-13 07:36:30 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-13 12:07:36 +0100
commitaa8c2f93d89cabdd7708b9bbb8d45d824e88a71f (patch)
tree24cc9bfbe52f9b82b0118ff17a8f9ca729907bbb /src/quick
parent28113c7c8b74f957be812b61b861efc5bac12c3e (diff)
Abort rendering when QOpenGLContext::create/makeCurrent fails.
Task-number: QTBUG-30158 Change-Id: Ic8239fe6f074c989e4474d46042e1a82796b4908 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index 85ef549397..a55658bf71 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -245,20 +245,28 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
return;
}
+ bool current = false;
+
if (!gl) {
gl = new QOpenGLContext();
gl->setFormat(masterWindow->requestedFormat());
- gl->create();
- if (!gl->makeCurrent(masterWindow))
- qWarning("QQuickWindow: makeCurrent() failed...");
- sg->initialize(gl);
+ if (!gl->create()) {
+ delete gl;
+ gl = 0;
+ }
+ current = gl->makeCurrent(masterWindow);
+ if (current)
+ sg->initialize(gl);
} else {
- gl->makeCurrent(masterWindow);
+ current = gl->makeCurrent(masterWindow);
}
bool alsoSwap = data.updatePending;
data.updatePending = false;
+ if (!current)
+ return;
+
QQuickWindowPrivate *cd = QQuickWindowPrivate::get(window);
cd->polishItems();