summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/gui/painting
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/gui/painting')
-rw-r--r--tests/benchmarks/gui/painting/CMakeLists.txt3
-rw-r--r--tests/benchmarks/gui/painting/drawtexture/CMakeLists.txt8
-rw-r--r--tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp29
-rw-r--r--tests/benchmarks/gui/painting/lancebench/CMakeLists.txt12
-rw-r--r--tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp35
-rw-r--r--tests/benchmarks/gui/painting/qcolor/CMakeLists.txt8
-rw-r--r--tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp29
-rw-r--r--tests/benchmarks/gui/painting/qpainter/CMakeLists.txt8
-rw-r--r--tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp86
-rw-r--r--tests/benchmarks/gui/painting/qregion/CMakeLists.txt8
-rw-r--r--tests/benchmarks/gui/painting/qregion/main.cpp29
-rw-r--r--tests/benchmarks/gui/painting/qtbench/CMakeLists.txt8
-rw-r--r--tests/benchmarks/gui/painting/qtbench/benchmarktests.h35
-rw-r--r--tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp36
-rw-r--r--tests/benchmarks/gui/painting/qtransform/CMakeLists.txt8
-rw-r--r--tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp29
16 files changed, 108 insertions, 263 deletions
diff --git a/tests/benchmarks/gui/painting/CMakeLists.txt b/tests/benchmarks/gui/painting/CMakeLists.txt
index 080fe582f2..2313688038 100644
--- a/tests/benchmarks/gui/painting/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from painting.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(drawtexture)
add_subdirectory(qcolor)
diff --git a/tests/benchmarks/gui/painting/drawtexture/CMakeLists.txt b/tests/benchmarks/gui/painting/drawtexture/CMakeLists.txt
index 2d30686339..1e9af29d7f 100644
--- a/tests/benchmarks/gui/painting/drawtexture/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/drawtexture/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from drawtexture.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_drawtexture Binary:
@@ -7,11 +8,8 @@
qt_internal_add_benchmark(tst_bench_drawtexture
SOURCES
tst_drawtexture.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:drawtexture.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp b/tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp
index c16e68a0b1..4ab0a2db1e 100644
--- a/tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp
+++ b/tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 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) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QPainter>
diff --git a/tests/benchmarks/gui/painting/lancebench/CMakeLists.txt b/tests/benchmarks/gui/painting/lancebench/CMakeLists.txt
index 0d22641117..bfdd4df1c9 100644
--- a/tests/benchmarks/gui/painting/lancebench/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/lancebench/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from lancebench.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_lancebench Binary:
@@ -10,7 +11,7 @@ qt_internal_add_benchmark(tst_bench_lancebench
tst_lancebench.cpp
INCLUDE_DIRECTORIES
../../../../baseline/shared
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Test
@@ -60,15 +61,10 @@ qt_internal_add_resource(tst_bench_lancebench "images"
${images_resource_files}
)
-
-#### Keys ignored in scope 1:.:.:lancebench.pro:<TRUE>:
-# TEMPLATE = "app"
-# TESTDATA = "../../../../baseline/painting/scripts/*"
-
## Scopes:
#####################################################################
qt_internal_extend_target(tst_bench_lancebench CONDITION QT_FEATURE_opengl
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::OpenGL
)
diff --git a/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp b/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp
index b6f7d693b9..67bef8ebfe 100644
--- a/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp
+++ b/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 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) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "paintcommands.h"
@@ -96,7 +71,7 @@ tst_LanceBench::tst_LanceBench()
void tst_LanceBench::initTestCase()
{
- QString baseDir = QFINDTESTDATA("../../../../auto/other/lancelot/scripts/text.qps");
+ QString baseDir = QFINDTESTDATA("../../../../baseline/painting/scripts/text.qps");
scriptsDir = baseDir.left(baseDir.lastIndexOf('/')) + '/';
QDir qpsDir(scriptsDir);
qpsFiles = qpsDir.entryList(QStringList() << QLatin1String("*.qps"), QDir::Files | QDir::Readable);
@@ -106,7 +81,7 @@ void tst_LanceBench::initTestCase()
}
std::sort(qpsFiles.begin(), qpsFiles.end());
- for (const QString& fileName : qAsConst(qpsFiles)) {
+ for (const QString& fileName : std::as_const(qpsFiles)) {
QFile file(scriptsDir + fileName);
file.open(QFile::ReadOnly);
QByteArray cont = file.readAll();
@@ -262,7 +237,7 @@ void tst_LanceBench::testCoreOpenGL()
void tst_LanceBench::setupTestSuite(const QStringList& blacklist)
{
QTest::addColumn<QString>("qpsFile");
- for (const QString &fileName : qAsConst(qpsFiles)) {
+ for (const QString &fileName : std::as_const(qpsFiles)) {
if (blacklist.contains(fileName))
continue;
QTest::newRow(fileName.toLatin1()) << fileName;
diff --git a/tests/benchmarks/gui/painting/qcolor/CMakeLists.txt b/tests/benchmarks/gui/painting/qcolor/CMakeLists.txt
index d482102f1b..a450c698bf 100644
--- a/tests/benchmarks/gui/painting/qcolor/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/qcolor/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qcolor.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qcolor Binary:
@@ -7,11 +8,8 @@
qt_internal_add_benchmark(tst_bench_qcolor
SOURCES
tst_qcolor.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qcolor.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp b/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp
index 52a7673c0c..02fe3f986e 100644
--- a/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp
+++ b/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
-** 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 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QColor>
diff --git a/tests/benchmarks/gui/painting/qpainter/CMakeLists.txt b/tests/benchmarks/gui/painting/qpainter/CMakeLists.txt
index ce302599cf..13a99ecc1d 100644
--- a/tests/benchmarks/gui/painting/qpainter/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/qpainter/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qpainter.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qpainter Binary:
@@ -7,13 +8,10 @@
qt_internal_add_benchmark(tst_bench_qpainter
SOURCES
tst_qpainter.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Test
Qt::Widgets
Qt::WidgetsPrivate
)
-
-#### Keys ignored in scope 1:.:.:qpainter.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
index d0719d716b..7954e964b3 100644
--- a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
@@ -1,30 +1,7 @@
-/****************************************************************************
-**
-** 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
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include <qtest.h>
#include <QPainter>
@@ -220,6 +197,9 @@ private slots:
void drawTransformedSemiTransparentImage();
void drawTransformedFilledImage();
+ void drawPathExceedingDevice_data();
+ void drawPathExceedingDevice();
+
private:
void setupBrushes();
void createPrimitives();
@@ -695,7 +675,7 @@ void tst_QPainter::drawPixmapImage_data_helper(bool pixmaps)
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 (const QSize &s : std::as_const(sizes)) {
for (int type=0; type<=3; ++type) {
QString name = QString::fromLatin1("%1 on %2, (%3x%4), %5")
.arg(formatNames[*sourceFormats])
@@ -1684,6 +1664,56 @@ void tst_QPainter::drawTransformedFilledImage()
}
}
+void tst_QPainter::drawPathExceedingDevice_data()
+{
+ QTest::addColumn<int>("dim");
+ QTest::addColumn<QPainterPath>("path");
+
+ const int dim = 512;
+ QPainterPath p;
+ const int ext = 10 * dim;
+ for (int i = 0; i < ext; i += (ext / 50)) {
+ p.lineTo(ext, i);
+ p.lineTo(0, dim);
+ p.moveTo(0, 0);
+ }
+
+ {
+ QPainterPath preClip;
+ preClip.addRect(0, 0, dim, dim);
+ QTest::newRow("devicesize") << dim << p.intersected(preClip);
+ }
+
+ {
+ QPainterPath preClip;
+ preClip.addRect(0, 0, 2*dim, 2*dim);
+ QTest::newRow("devicesizex2") << dim << p.intersected(preClip);
+ }
+
+ {
+ QPainterPath preClip;
+ preClip.addRect(0, 0, 5*dim, 5*dim);
+ QTest::newRow("devicesizex5") << dim << p.intersected(preClip);
+ }
+
+ QTest::newRow("devicesizex10") << dim << p;
+}
+
+void tst_QPainter::drawPathExceedingDevice()
+{
+ QFETCH(int, dim);
+ QFETCH(QPainterPath, path);
+
+ QImage img(dim, dim, QImage::Format_RGB32);
+ QPainter p(&img);
+ p.setRenderHint(QPainter::Antialiasing);
+ p.setPen(QPen(Qt::black, 3));
+ p.setBrush(Qt::NoBrush);
+
+ QBENCHMARK {
+ p.drawPath(path);
+ }
+}
QTEST_MAIN(tst_QPainter)
diff --git a/tests/benchmarks/gui/painting/qregion/CMakeLists.txt b/tests/benchmarks/gui/painting/qregion/CMakeLists.txt
index 43d397c456..c242a2f588 100644
--- a/tests/benchmarks/gui/painting/qregion/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/qregion/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qregion.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qregion Binary:
@@ -7,10 +8,7 @@
qt_internal_add_benchmark(tst_bench_qregion
SOURCES
main.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qregion.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/painting/qregion/main.cpp b/tests/benchmarks/gui/painting/qregion/main.cpp
index 9e926780ab..696972c140 100644
--- a/tests/benchmarks/gui/painting/qregion/main.cpp
+++ b/tests/benchmarks/gui/painting/qregion/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
// This file contains benchmarks for QRegion functions.
#include <QDebug>
diff --git a/tests/benchmarks/gui/painting/qtbench/CMakeLists.txt b/tests/benchmarks/gui/painting/qtbench/CMakeLists.txt
index e6e2ed76ab..68fbf0984f 100644
--- a/tests/benchmarks/gui/painting/qtbench/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/qtbench/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qtbench.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qtbench Binary:
@@ -7,11 +8,8 @@
qt_internal_add_benchmark(tst_bench_qtbench
SOURCES
tst_qtbench.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
Qt::Widgets
)
-
-#### Keys ignored in scope 1:.:.:qtbench.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
index bffdd5bf2d..9d890f1577 100644
--- a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
+++ b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the FOO module 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
#ifndef BENCHMARKTESTS_H
#define BENCHMARKTESTS_H
@@ -554,13 +529,13 @@ public:
m_staticTexts.append(staticText);
QFontMetrics fm(p->font());
- m_size = QSize(fm.horizontalAdvance(m_text, m_text.length()), fm.height());
+ m_size = QSize(fm.horizontalAdvance(m_text, m_text.size()), fm.height());
break;
}
case PainterQPointMode: {
QFontMetrics fm(p->font());
- m_size = QSize(fm.horizontalAdvance(m_text, m_text.length()), fm.height());
+ m_size = QSize(fm.horizontalAdvance(m_text, m_text.size()), fm.height());
break;
}
@@ -601,7 +576,7 @@ public:
QString name() const override
{
- int letters = m_text.length();
+ int letters = m_text.size();
int lines = m_text.count('\n');
if (lines == 0)
lines = 1;
diff --git a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
index c44eeb3b67..45b7045f94 100644
--- a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
+++ b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
@@ -1,30 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 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) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include <qtest.h>
@@ -132,9 +109,13 @@ class tst_QtBench : public QObject
{
Q_OBJECT
+ QList<Benchmark *> benchmarks;
+
private slots:
void qtBench();
void qtBench_data();
+
+ void cleanupTestCase() { qDeleteAll(benchmarks); }
};
QString makeString(int length)
@@ -184,7 +165,6 @@ void tst_QtBench::qtBench_data()
"i erat, sed pellentesque\n"
"mi. Curabitur sed.";
- QList<Benchmark *> benchmarks;
benchmarks << (new DrawText(shortString, DrawText::PainterMode));
benchmarks << (new DrawText(middleString, DrawText::PainterMode));
benchmarks << (new DrawText(longString, DrawText::PainterMode));
diff --git a/tests/benchmarks/gui/painting/qtransform/CMakeLists.txt b/tests/benchmarks/gui/painting/qtransform/CMakeLists.txt
index b9adb340dc..8915ca3eb7 100644
--- a/tests/benchmarks/gui/painting/qtransform/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/qtransform/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qtransform.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qtransform Binary:
@@ -7,10 +8,7 @@
qt_internal_add_benchmark(tst_bench_qtransform
SOURCES
tst_qtransform.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qtransform.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp
index 68054f1b88..e6442d0dff 100644
--- a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp
+++ b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.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 <QTransform>