summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/gui
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/gui')
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp6
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp3
-rw-r--r--tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro7
-rw-r--r--tests/benchmarks/gui/image/qimagereader/qimagereader.pro21
-rw-r--r--tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp89
-rw-r--r--tests/benchmarks/gui/text/qtextdocument/main.cpp71
-rw-r--r--tests/benchmarks/gui/text/qtextdocument/qtextdocument.pro7
-rw-r--r--tests/benchmarks/gui/text/text.pro3
10 files changed, 159 insertions, 52 deletions
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp
index 70b9134718..de4e9e5ad7 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp
@@ -30,7 +30,7 @@
#include <QtGui>
-#ifdef Q_DEAD_CODE_FROM_QT4_WIN
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
#define CALLGRIND_START_INSTRUMENTATION {}
#define CALLGRIND_STOP_INSTRUMENTATION {}
#else
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp
index 957ad06783..6c97f94683 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp
@@ -27,14 +27,14 @@
****************************************************************************/
#include <QtGui>
-#ifdef Q_DEAD_CODE_FROM_QT4_WIN
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
#define CALLGRIND_START_INSTRUMENTATION {}
#define CALLGRIND_STOP_INSTRUMENTATION {}
#else
#include "valgrind/callgrind.h"
#endif
-#ifdef Q_DEAD_CODE_FROM_QT4_X11
+#if 0 // Used to be included in Qt4 for Q_WS_X11
extern void qt_x11_wait_for_window_manager(QWidget *);
#endif
@@ -89,7 +89,7 @@ int main(int argc, char *argv[])
View view(&scene, item);
view.resize(300, 300);
view.show();
-#ifdef Q_DEAD_CODE_FROM_QT4_X11
+#if 0 // Used to be included in Qt4 for Q_WS_X11
qt_x11_wait_for_window_manager(&view);
#endif
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp
index 5b6083d5ac..1fbb229cd8 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp
@@ -27,7 +27,7 @@
****************************************************************************/
#include <QtGui>
-#ifdef Q_DEAD_CODE_FROM_QT4_WIN
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
#define CALLGRIND_START_INSTRUMENTATION {}
#define CALLGRIND_STOP_INSTRUMENTATION {}
#else
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 7f52bb0eba..0064ecbaaf 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -401,9 +401,6 @@ void tst_QGraphicsView::chipTester_data()
void tst_QGraphicsView::chipTester()
{
-#ifdef Q_OS_WINCE_WM
- QSKIP("WinCE WM: Fails on Windows Mobile w/o OpenGL");
-#endif
QFETCH(bool, antialias);
QFETCH(bool, opengl);
QFETCH(int, operation);
diff --git a/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro b/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro
index 9e47f979e1..e152ac8200 100644
--- a/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro
+++ b/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro
@@ -1,8 +1,9 @@
TEMPLATE = app
TARGET = tst_bench_imageConversion
QT += testlib
+QT_FOR_CONFIG += gui-private
SOURCES += tst_qimageconversion.cpp
-!contains(QT_CONFIG, no-gif):DEFINES += QTEST_HAVE_GIF
-!contains(QT_CONFIG, no-jpeg):DEFINES += QTEST_HAVE_JPEG
-contains(QT_CONFIG, c++11): CONFIG += c++11
+qtConfig(gif): DEFINES += QTEST_HAVE_GIF
+qtConfig(jpeg): DEFINES += QTEST_HAVE_JPEG
+qtConfig(c++11): CONFIG += c++11
diff --git a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
index e54e2ffce5..33e0c50bba 100644
--- a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
+++ b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
@@ -1,26 +1,11 @@
QT += testlib
+QT_FOR_CONFIG += gui-private
TEMPLATE = app
TARGET = tst_bench_qimagereader
SOURCES += tst_qimagereader.cpp
-!contains(QT_CONFIG, no-gif):DEFINES += QTEST_HAVE_GIF
-!contains(QT_CONFIG, no-jpeg):DEFINES += QTEST_HAVE_JPEG
+qtConfig(gif): DEFINES += QTEST_HAVE_GIF
+qtConfig(jpeg): DEFINES += QTEST_HAVE_JPEG
QT += network
-
-wince {
- addFiles.files = images
- addFiles.path = .
-
- CONFIG(debug, debug|release):{
- imageFormatsPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/*d4.dll
- }
-
- CONFIG(release, debug|release):{
- imageFormatsPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/*[^d]4.dll
- }
- imageFormatsPlugins.path = imageformats
- DEPLOYMENT += addFiles imageFormatsPlugins
-}
-
diff --git a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
index 8af9077347..ea08af7608 100644
--- a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
@@ -228,6 +228,7 @@ private:
void createPrimitives();
void drawPrimitives_data_helper(bool fancypens);
+ void drawPixmapImage_data_helper(bool);
void fillPrimitives_helper(QPainter *painter, PrimitiveType type, PrimitiveSet *s);
QTransform transformForAngle(qreal angle);
@@ -608,7 +609,7 @@ void tst_QPainter::drawLine_antialiased_clipped()
p.end();
}
-void tst_QPainter::drawPixmap_data()
+void tst_QPainter::drawPixmapImage_data_helper(bool pixmaps)
{
QTest::addColumn<QImage::Format>("sourceFormat");
QTest::addColumn<QImage::Format>("targetFormat");
@@ -644,32 +645,71 @@ void tst_QPainter::drawPixmap_data()
"ARGB8555_pm",
"RGB888",
"RGB444",
- "ARGB4444_pm"
+ "ARGB4444_pm",
+ "RGBx8888",
+ "RGBA8888",
+ "RGBA8888_pm",
+ "BGR30",
+ "A2BGR30_pm",
+ "RGB30",
+ "A2RGB30_pm",
+ "Alpha8",
+ "Grayscale8",
+ };
+
+ const QImage::Format pixmapFormats[] = {
+ QImage::Format_RGB32,
+ QImage::Format_ARGB32_Premultiplied,
+ QImage::Format_RGB16,
+ QImage::Format_ARGB8565_Premultiplied,
+ QImage::Format_BGR30,
+ QImage::Format_Invalid
};
- for (int tar=4; tar<QImage::NImageFormats; ++tar) {
- for (int src=4; src<QImage::NImageFormats; ++src) {
-
- // skip the low-priority formats to keep resultset manageable...
- if (tar == QImage::Format_RGB444 || src == QImage::Format_RGB444
- || tar == QImage::Format_RGB555 || src == QImage::Format_RGB555
- || tar == QImage::Format_RGB666 || src == QImage::Format_RGB666
- || tar == QImage::Format_RGB888 || src == QImage::Format_RGB888
- || tar == QImage::Format_ARGB4444_Premultiplied
- || src == QImage::Format_ARGB4444_Premultiplied
- || tar == QImage::Format_ARGB6666_Premultiplied
- || src == QImage::Format_ARGB6666_Premultiplied)
- continue;
-
- foreach (const QSize &s, sizes) {
+ const QImage::Format targetImageFormats[] = {
+ QImage::Format_RGB32,
+ QImage::Format_ARGB32,
+ QImage::Format_ARGB32_Premultiplied,
+ QImage::Format_RGB16,
+ QImage::Format_ARGB8565_Premultiplied,
+ QImage::Format_RGBX8888,
+ QImage::Format_RGBA8888_Premultiplied,
+ QImage::Format_BGR30,
+ QImage::Format_A2RGB30_Premultiplied,
+ QImage::Format_Grayscale8,
+ QImage::Format_Invalid
+ };
+
+ const QImage::Format sourceImageFormats[] = {
+ QImage::Format_Indexed8,
+ QImage::Format_RGB32,
+ QImage::Format_ARGB32,
+ QImage::Format_ARGB32_Premultiplied,
+ QImage::Format_RGB16,
+ QImage::Format_ARGB8565_Premultiplied,
+ QImage::Format_RGB888,
+ QImage::Format_RGBX8888,
+ QImage::Format_RGBA8888,
+ QImage::Format_RGBA8888_Premultiplied,
+ QImage::Format_A2BGR30_Premultiplied,
+ QImage::Format_RGB30,
+ QImage::Format_Grayscale8,
+ QImage::Format_Invalid
+ };
+
+ const QImage::Format *targetFormats = pixmaps ? pixmapFormats : targetImageFormats;
+ for (; *targetFormats != QImage::Format_Invalid; ++targetFormats) {
+ const QImage::Format *sourceFormats = pixmaps ? pixmapFormats : sourceImageFormats;
+ for (; *sourceFormats != QImage::Format_Invalid; ++sourceFormats) {
+ for (const QSize &s : qAsConst(sizes)) {
for (int type=0; type<=3; ++type) {
QString name = QString::fromLatin1("%1 on %2, (%3x%4), %5")
- .arg(formatNames[src])
- .arg(formatNames[tar])
+ .arg(formatNames[*sourceFormats])
+ .arg(formatNames[*targetFormats])
.arg(s.width()).arg(s.height())
.arg(typeNames[type]);
- QTest::newRow(name.toLatin1()) << (QImage::Format) src
- << (QImage::Format) tar
+ QTest::newRow(name.toLatin1()) << *sourceFormats
+ << *targetFormats
<< s
<< type;
}
@@ -703,6 +743,11 @@ static QImage createImage(int type, const QSize &size) {
}
+void tst_QPainter::drawPixmap_data()
+{
+ drawPixmapImage_data_helper(true);
+}
+
void tst_QPainter::drawPixmap()
{
QFETCH(QImage::Format, sourceFormat);
@@ -725,7 +770,7 @@ void tst_QPainter::drawPixmap()
void tst_QPainter::drawImage_data()
{
- drawPixmap_data();
+ drawPixmapImage_data_helper(false);
}
diff --git a/tests/benchmarks/gui/text/qtextdocument/main.cpp b/tests/benchmarks/gui/text/qtextdocument/main.cpp
new file mode 100644
index 0000000000..17fee3b2eb
--- /dev/null
+++ b/tests/benchmarks/gui/text/qtextdocument/main.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Robin Burchell <robin.burchell@viroteck.net>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDebug>
+#include <QTextDocument>
+#include <qtest.h>
+
+class tst_QTextDocument : public QObject
+{
+ Q_OBJECT
+private slots:
+ void mightBeRichText_data();
+ void mightBeRichText();
+};
+
+void tst_QTextDocument::mightBeRichText_data()
+{
+ QTest::addColumn<QString>("source");
+ QTest::addColumn<bool>("isMaybeRichText");
+ QTest::newRow("empty") << QString() << false;
+ QTest::newRow("simple") << QString::fromLatin1("<html><b>Foo</b></html>") << true;
+ QTest::newRow("simple2") << QString::fromLatin1("<b>Foo</b>") << true;
+ QTest::newRow("documentation-header") << QString("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"
+ "<!DOCTYPE html\n"
+ " PUBLIC ""-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n"
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">")
+ << true;
+ QTest::newRow("br-nospace") << QString("Test <br/> new line") << true;
+ QTest::newRow("br-space") << QString("Test <br /> new line") << true;
+ QTest::newRow("br-invalidspace") << QString("Test <br/ > new line") << false;
+ QTest::newRow("invalid closing tag") << QString("Test <br/ line") << false;
+ QTest::newRow("no tags") << QString("Test line") << false;
+}
+
+void tst_QTextDocument::mightBeRichText()
+{
+ QFETCH(QString, source);
+ QFETCH(bool, isMaybeRichText);
+ QBENCHMARK {
+ QCOMPARE(isMaybeRichText, Qt::mightBeRichText(source));
+ }
+}
+
+QTEST_MAIN(tst_QTextDocument)
+
+#include "main.moc"
diff --git a/tests/benchmarks/gui/text/qtextdocument/qtextdocument.pro b/tests/benchmarks/gui/text/qtextdocument/qtextdocument.pro
new file mode 100644
index 0000000000..67cef8b25c
--- /dev/null
+++ b/tests/benchmarks/gui/text/qtextdocument/qtextdocument.pro
@@ -0,0 +1,7 @@
+QT += testlib
+QT += gui-private
+
+TEMPLATE = app
+TARGET = tst_bench_QTextDocument
+
+SOURCES += main.cpp
diff --git a/tests/benchmarks/gui/text/text.pro b/tests/benchmarks/gui/text/text.pro
index 34e548b4d3..6dc4f5d16e 100644
--- a/tests/benchmarks/gui/text/text.pro
+++ b/tests/benchmarks/gui/text/text.pro
@@ -1,4 +1,5 @@
TEMPLATE = subdirs
SUBDIRS = \
qfontmetrics \
- qtext
+ qtext \
+ qtextdocument