From 00c869a5c605d7f82146c5a1d3f4f80ca706ca16 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 26 Nov 2019 15:09:58 +0100 Subject: 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 --- .../gui/painting/lancebench/tst_lancebench.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tests/benchmarks') 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(); -- cgit v1.2.3