summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/gui
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-26 15:09:58 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-28 19:52:16 +0000
commit00c869a5c605d7f82146c5a1d3f4f80ca706ca16 (patch)
treec6c8ff8afee916b69e0798694e323ee038cca3aa /tests/benchmarks/gui
parent9feb20e58128ae7e8d208847ce989b65cdfcf5bc (diff)
Fix lancelot PaintCommands for reuse
Some structures needed to be cleaned for the reuse to be safe. Reusing it cuts down on the overhead in lancebench. Also uniqueness of block names are now enforced, and the common pattern of "end_block blockName" could now be parsed if not always commented out by begin_block handling. Change-Id: I0daf6445292383aaab9392550d0842e0a654ad27 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'tests/benchmarks/gui')
-rw-r--r--tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp20
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 d26ac016b9..bd0889bf4a 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();