summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond.kjernasen@nokia.com>2010-10-06 13:04:31 (GMT)
committerTrond Kjernåsen <trond.kjernasen@nokia.com>2010-10-06 13:04:31 (GMT)
commit52111401594472503ce21096fc720807a9253b8d (patch)
treee1b694c8ef533eb43241a1bd058cc71811bfdd13 /tests/auto
parent72b1a614748add429f301ea156760fafc01a5128 (diff)
downloadQt-52111401594472503ce21096fc720807a9253b8d.zip
Qt-52111401594472503ce21096fc720807a9253b8d.tar.gz
Qt-52111401594472503ce21096fc720807a9253b8d.tar.bz2
Add support for blacklisting/whitelisting tests on the report page.
Also changed how the GL tests are run: they now render into a multisampled FBO, which seems to be more stable than to a plain GL widget.
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/lancelot/tst_lancelot.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/auto/lancelot/tst_lancelot.cpp b/tests/auto/lancelot/tst_lancelot.cpp
index d7a675d..21044d4 100644
--- a/tests/auto/lancelot/tst_lancelot.cpp
+++ b/tests/auto/lancelot/tst_lancelot.cpp
@@ -189,10 +189,11 @@ void tst_Lancelot::testOpenGL_data()
void tst_Lancelot::testOpenGL()
{
bool ok = false;
- QGLWidget glWidget;
+ QGLWidget glWidget;
if (glWidget.isValid() && glWidget.format().directRendering()
&& ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0)
- || (QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0)))
+ || (QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0))
+ && QGLFramebufferObject::hasOpenGLFramebufferObjects())
{
glWidget.makeCurrent();
if (!QByteArray((const char *)glGetString(GL_VERSION)).contains("Mesa"))
@@ -272,13 +273,13 @@ ImageItem tst_Lancelot::render(const ImageItem &item)
} else if (item.engine == ImageItem::OpenGL) {
QGLWidget glWidget;
if (glWidget.isValid()) {
- glWidget.resize(800, 800);
- glWidget.show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&glWidget);
-#endif
- paint(&glWidget, script, QFileInfo(filePath).absoluteFilePath()); // eh yuck (filePath stuff)
- res.image = glWidget.grabFrameBuffer().convertToFormat(item.renderFormat);
+ glWidget.makeCurrent();
+ QGLFramebufferObjectFormat fboFormat;
+ fboFormat.setSamples(16);
+ fboFormat.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+ QGLFramebufferObject fbo(800, 800, fboFormat);
+ paint(&fbo, script, QFileInfo(filePath).absoluteFilePath()); // eh yuck (filePath stuff)
+ res.image = fbo.toImage().convertToFormat(item.renderFormat);
res.imageChecksums.append(ImageItem::computeChecksum(res.image));
}
}
@@ -290,6 +291,7 @@ void tst_Lancelot::paint(QPaintDevice *device, const QStringList &script, const
{
QPainter p(device);
PaintCommands pcmd(script, 800, 800);
+ pcmd.setType(ImageType);
pcmd.setPainter(&p);
pcmd.setFilePath(filePath);
pcmd.runCommands();