Further restrict the threaded opengl example

Mesa llvmpipe (e.g. the opengl32sw.dll we are shipping) cannot
handle threading either.

Change-Id: Id822736c4a9eef39e56776dcd1f398fc31ebc0f4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Laszlo Agocs 2014-10-23 13:42:17 +02:00
parent feaa1e6373
commit c1fc540273

View File

@ -75,26 +75,31 @@ int main( int argc, char ** argv )
+ QLatin1Char('/') + getGlString(topLevelGlWidget.context()->functions(), GL_RENDERER); + QLatin1Char('/') + getGlString(topLevelGlWidget.context()->functions(), GL_RENDERER);
const bool supportsThreading = !glInfo.contains(QLatin1String("nouveau"), Qt::CaseInsensitive) const bool supportsThreading = !glInfo.contains(QLatin1String("nouveau"), Qt::CaseInsensitive)
&& !glInfo.contains(QLatin1String("ANGLE"), Qt::CaseInsensitive); && !glInfo.contains(QLatin1String("ANGLE"), Qt::CaseInsensitive)
&& !glInfo.contains(QLatin1String("llvmpipe"), Qt::CaseInsensitive);
const QString toolTip = supportsThreading ? glInfo : glInfo + QStringLiteral("\ndoes not support threaded OpenGL."); const QString toolTip = supportsThreading ? glInfo : glInfo + QStringLiteral("\ndoes not support threaded OpenGL.");
topLevelGlWidget.setToolTip(toolTip); topLevelGlWidget.setToolTip(toolTip);
QScopedPointer<MainWindow> mw1; QScopedPointer<MainWindow> mw1;
QScopedPointer<MainWindow> mw2; QScopedPointer<MainWindow> mw2;
if (supportsThreading && !QApplication::arguments().contains(QStringLiteral("--single"))) { if (!QApplication::arguments().contains(QStringLiteral("--single"))) {
pos += QPoint(100, 100); if (supportsThreading) {
mw1.reset(new MainWindow); pos += QPoint(100, 100);
mw1->setToolTip(toolTip); mw1.reset(new MainWindow);
mw1->move(pos); mw1->setToolTip(toolTip);
mw1->setWindowTitle(QStringLiteral("Threaded QOpenGLWidget example #1")); mw1->move(pos);
mw1->show(); mw1->setWindowTitle(QStringLiteral("Threaded QOpenGLWidget example #1"));
pos += QPoint(100, 100); mw1->show();
mw2.reset(new MainWindow); pos += QPoint(100, 100);
mw2->setToolTip(toolTip); mw2.reset(new MainWindow);
mw2->move(pos); mw2->setToolTip(toolTip);
mw2->setWindowTitle(QStringLiteral("Threaded QOpenGLWidget example #2")); mw2->move(pos);
mw2->show(); mw2->setWindowTitle(QStringLiteral("Threaded QOpenGLWidget example #2"));
mw2->show();
} else {
qWarning() << toolTip;
}
} }
return a.exec(); return a.exec();