summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/gui/image
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/gui/image')
-rw-r--r--tests/benchmarks/gui/image/CMakeLists.txt3
-rw-r--r--tests/benchmarks/gui/image/blendbench/CMakeLists.txt8
-rw-r--r--tests/benchmarks/gui/image/blendbench/main.cpp29
-rw-r--r--tests/benchmarks/gui/image/qimageconversion/CMakeLists.txt9
-rw-r--r--tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp29
-rw-r--r--tests/benchmarks/gui/image/qimagereader/CMakeLists.txt13
-rw-r--r--tests/benchmarks/gui/image/qimagereader/tst_bench_qimagereader.cpp (renamed from tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp)91
-rw-r--r--tests/benchmarks/gui/image/qimagescale/CMakeLists.txt8
-rw-r--r--tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp29
-rw-r--r--tests/benchmarks/gui/image/qpixmap/CMakeLists.txt8
-rw-r--r--tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp29
-rw-r--r--tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt8
-rw-r--r--tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp29
13 files changed, 73 insertions, 220 deletions
diff --git a/tests/benchmarks/gui/image/CMakeLists.txt b/tests/benchmarks/gui/image/CMakeLists.txt
index 77cfeedc3e..53768eda4c 100644
--- a/tests/benchmarks/gui/image/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from image.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(blendbench)
add_subdirectory(qimageconversion)
diff --git a/tests/benchmarks/gui/image/blendbench/CMakeLists.txt b/tests/benchmarks/gui/image/blendbench/CMakeLists.txt
index d0d61cea19..88a47c894b 100644
--- a/tests/benchmarks/gui/image/blendbench/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/blendbench/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from blendbench.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_blendbench Binary:
@@ -7,10 +8,7 @@
qt_internal_add_benchmark(tst_bench_blendbench
SOURCES
main.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:blendbench.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/image/blendbench/main.cpp b/tests/benchmarks/gui/image/blendbench/main.cpp
index 039d822a39..4aaf89d029 100644
--- a/tests/benchmarks/gui/image/blendbench/main.cpp
+++ b/tests/benchmarks/gui/image/blendbench/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtGui>
#include <QString>
diff --git a/tests/benchmarks/gui/image/qimageconversion/CMakeLists.txt b/tests/benchmarks/gui/image/qimageconversion/CMakeLists.txt
index f67a2b6908..034ed28fcd 100644
--- a/tests/benchmarks/gui/image/qimageconversion/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/qimageconversion/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qimageconversion.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_imageConversion Binary:
@@ -7,15 +8,11 @@
qt_internal_add_benchmark(tst_bench_imageConversion
SOURCES
tst_qimageconversion.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-#### Keys ignored in scope 1:.:.:qimageconversion.pro:<TRUE>:
-# QT_FOR_CONFIG = "gui-private"
-# TEMPLATE = "app"
-
## Scopes:
#####################################################################
diff --git a/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
index afc9292c1d..0c4243637c 100644
--- a/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
+++ b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QImage>
diff --git a/tests/benchmarks/gui/image/qimagereader/CMakeLists.txt b/tests/benchmarks/gui/image/qimagereader/CMakeLists.txt
index d0ef0e3984..ba3c2a7ec4 100644
--- a/tests/benchmarks/gui/image/qimagereader/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/qimagereader/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qimagereader.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qimagereader Binary:
@@ -6,17 +7,13 @@
qt_internal_add_benchmark(tst_bench_qimagereader
SOURCES
- tst_qimagereader.cpp
- PUBLIC_LIBRARIES
+ tst_bench_qimagereader.cpp
+ LIBRARIES
+ Qt::CorePrivate
Qt::Gui
Qt::Test
)
-#### Keys ignored in scope 1:.:.:qimagereader.pro:<TRUE>:
-# QT_FOR_CONFIG = "gui-private"
-# TEMPLATE = "app"
-# TESTDATA = "images/*"
-
## Scopes:
#####################################################################
diff --git a/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp b/tests/benchmarks/gui/image/qimagereader/tst_bench_qimagereader.cpp
index 48e838148f..9b23741405 100644
--- a/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/benchmarks/gui/image/qimagereader/tst_bench_qimagereader.cpp
@@ -1,32 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
+
#include <QBuffer>
#include <QDebug>
#include <QFile>
@@ -34,6 +10,8 @@
#include <QImageReader>
#include <QImageWriter>
#include <QPixmap>
+
+#include <QtCore/private/qfactoryloader_p.h>
#include <QSet>
#include <QTimer>
@@ -42,20 +20,20 @@ typedef QList<int> QIntList;
Q_DECLARE_METATYPE(QStringMap)
Q_DECLARE_METATYPE(QIntList)
-class tst_QImageReader : public QObject
+class tst_bench_QImageReader : public QObject
{
Q_OBJECT
public:
- tst_QImageReader();
- virtual ~tst_QImageReader();
+ tst_bench_QImageReader();
public slots:
void initTestCase();
- void init();
- void cleanup();
private slots:
+ void rawFactoryLoader_keyMap();
+ void rawFactoryLoader_instance();
+
void readImage_data();
void readImage();
@@ -71,9 +49,10 @@ private slots:
private:
QList< QPair<QString, QByteArray> > images; // filename, format
QString prefix;
+ QFactoryLoader m_loader{QImageIOHandlerFactoryInterface_iid, "/imageformats"};
};
-tst_QImageReader::tst_QImageReader()
+tst_bench_QImageReader::tst_bench_QImageReader()
{
images << QPair<QString, QByteArray>(QLatin1String("colorful.bmp"), QByteArray("bmp"));
images << QPair<QString, QByteArray>(QLatin1String("font.bmp"), QByteArray("bmp"));
@@ -100,26 +79,38 @@ tst_QImageReader::tst_QImageReader()
#endif
}
-tst_QImageReader::~tst_QImageReader()
-{
-}
-
-void tst_QImageReader::initTestCase()
+void tst_bench_QImageReader::initTestCase()
{
prefix = QFINDTESTDATA("images/");
if (prefix.isEmpty())
QFAIL("Can't find images directory!");
}
-void tst_QImageReader::init()
+void tst_bench_QImageReader::rawFactoryLoader_keyMap()
{
+ if (m_loader.keyMap().isEmpty())
+ QSKIP("No image plugins found.");
+
+ QBENCHMARK {
+ [[maybe_unused]] auto r = m_loader.keyMap();
+ }
}
-void tst_QImageReader::cleanup()
+void tst_bench_QImageReader::rawFactoryLoader_instance()
{
+ if (m_loader.keyMap().isEmpty())
+ QSKIP("No image plugins found.");
+
+ const auto numInstances = m_loader.keyMap().uniqueKeys().size();
+
+ QBENCHMARK {
+ for (int i = 0; i < numInstances; ++i)
+ delete m_loader.instance(i);
+ }
}
-void tst_QImageReader::readImage_data()
+
+void tst_bench_QImageReader::readImage_data()
{
QTest::addColumn<QString>("fileName");
QTest::addColumn<QByteArray>("format");
@@ -131,7 +122,7 @@ void tst_QImageReader::readImage_data()
}
}
-void tst_QImageReader::readImage()
+void tst_bench_QImageReader::readImage()
{
QFETCH(QString, fileName);
QFETCH(QByteArray, format);
@@ -143,7 +134,7 @@ void tst_QImageReader::readImage()
}
}
-void tst_QImageReader::setScaledSize_data()
+void tst_bench_QImageReader::setScaledSize_data()
{
QTest::addColumn<QString>("fileName");
QTest::addColumn<QByteArray>("format");
@@ -161,7 +152,7 @@ void tst_QImageReader::setScaledSize_data()
}
}
-void tst_QImageReader::setScaledSize()
+void tst_bench_QImageReader::setScaledSize()
{
QFETCH(QString, fileName);
QFETCH(QSize, newSize);
@@ -175,7 +166,7 @@ void tst_QImageReader::setScaledSize()
}
}
-void tst_QImageReader::setClipRect_data()
+void tst_bench_QImageReader::setClipRect_data()
{
QTest::addColumn<QString>("fileName");
QTest::addColumn<QByteArray>("format");
@@ -188,7 +179,7 @@ void tst_QImageReader::setClipRect_data()
}
}
-void tst_QImageReader::setClipRect()
+void tst_bench_QImageReader::setClipRect()
{
QFETCH(QString, fileName);
QFETCH(QRect, newRect);
@@ -202,12 +193,12 @@ void tst_QImageReader::setClipRect()
}
}
-void tst_QImageReader::setScaledClipRect_data()
+void tst_bench_QImageReader::setScaledClipRect_data()
{
setClipRect_data();
}
-void tst_QImageReader::setScaledClipRect()
+void tst_bench_QImageReader::setScaledClipRect()
{
QFETCH(QString, fileName);
QFETCH(QRect, newRect);
@@ -222,5 +213,5 @@ void tst_QImageReader::setScaledClipRect()
}
}
-QTEST_MAIN(tst_QImageReader)
-#include "tst_qimagereader.moc"
+QTEST_MAIN(tst_bench_QImageReader)
+#include "tst_bench_qimagereader.moc"
diff --git a/tests/benchmarks/gui/image/qimagescale/CMakeLists.txt b/tests/benchmarks/gui/image/qimagescale/CMakeLists.txt
index 51610fa567..74d5c8e470 100644
--- a/tests/benchmarks/gui/image/qimagescale/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/qimagescale/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qimagescale.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_imageScale Binary:
@@ -7,10 +8,7 @@
qt_internal_add_benchmark(tst_bench_imageScale
SOURCES
tst_qimagescale.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qimagescale.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp b/tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp
index 2ba3731e9b..2819dc1c11 100644
--- a/tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp
+++ b/tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QImage>
diff --git a/tests/benchmarks/gui/image/qpixmap/CMakeLists.txt b/tests/benchmarks/gui/image/qpixmap/CMakeLists.txt
index f8b1a4c754..db0546390a 100644
--- a/tests/benchmarks/gui/image/qpixmap/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/qpixmap/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qpixmap.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qpixmap Binary:
@@ -7,11 +8,8 @@
qt_internal_add_benchmark(tst_bench_qpixmap
SOURCES
tst_qpixmap.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qpixmap.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp b/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp
index 36f555ba61..7a6e4a2b3f 100644
--- a/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QBitmap>
diff --git a/tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt b/tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt
index 0f4a57c191..f2939ab470 100644
--- a/tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qpixmapcache.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qpixmapcache Binary:
@@ -7,10 +8,7 @@
qt_internal_add_benchmark(tst_bench_qpixmapcache
SOURCES
tst_qpixmapcache.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qpixmapcache.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
index b1f1a4c083..0c93e6d2ec 100644
--- a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QPixmapCache>