diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-07-22 14:00:20 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-07-23 11:47:51 +0000 |
commit | c21cc647e98327856006701ee59b798ef2723e85 (patch) | |
tree | 5e440acc32439863e5bda53bc37a2fa77b81500d /tests/benchmarks | |
parent | 86f91bf0f707e34392fbdf424d6914e7cf6bb4e6 (diff) |
Fix lancebench results oddness
Imports were expanded in the list of commands every time they were
evaluated. This meant any test with imports ran slower and slower the
more iterations it got through.
Fixed by creating a new PaintCommands object every time and living with
initialization of it being part of the benchmark results.
Change-Id: Ib53a3a25f1393437452bc5aede04ccb63e8715a6
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'tests/benchmarks')
-rw-r--r-- | tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp b/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp index bd0889bf4a..d26ac016b9 100644 --- a/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp +++ b/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp @@ -305,17 +305,17 @@ void tst_LanceBench::runTestSuite(GraphicsEngine engine, QImage::Format format, void tst_LanceBench::paint(QPaintDevice *device, GraphicsEngine engine, QImage::Format format, const QStringList &script, const QString &filePath) { - PaintCommands pcmd(script, 800, 800, format); - switch (engine) { - case OpenGL: - pcmd.setType(OpenGLBufferType); // version/profile is communicated through the context's format() - break; - case Raster: - pcmd.setType(ImageType); - break; - } - pcmd.setFilePath(filePath); QBENCHMARK { + PaintCommands pcmd(script, 800, 800, format); + switch (engine) { + case OpenGL: + pcmd.setType(OpenGLBufferType); // version/profile is communicated through the context's format() + break; + case Raster: + pcmd.setType(ImageType); + break; + } + pcmd.setFilePath(filePath); QPainter p(device); pcmd.setPainter(&p); pcmd.runCommands(); |