Bail out in composeAndFlush when makeCurrent fails

And show a warning so we have a chance of knowing what
happened.

Change-Id: I9ddf3842b7d19946876ac1a2375611e8c13bbb9a
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
bb10
Laszlo Agocs 2015-01-15 15:10:20 +01:00
parent 5582851c33
commit f939c3728c
1 changed files with 5 additions and 1 deletions

View File

@ -237,7 +237,11 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
{
Q_UNUSED(offset);
context->makeCurrent(window);
if (!context->makeCurrent(window)) {
qWarning("composeAndFlush: makeCurrent() failed");
return;
}
QOpenGLFunctions *funcs = context->functions();
funcs->glViewport(0, 0, window->width() * window->devicePixelRatio(), window->height() * window->devicePixelRatio());
funcs->glClearColor(0, 0, 0, translucentBackground ? 0 : 1);