From 5d691922d8b655e9376fb653ed99181aa70aae15 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 6 Sep 2016 11:00:02 +0200 Subject: Fix crash in QPainter benchmark test Adds missing image-formats so it doesn't segfault. Also changes the exclusion of rare formats to lists of included ones Change-Id: I1d00562cf8e96baa03121a0b996764224911e06a Reviewed-by: Gunnar Sletta --- .../gui/painting/qpainter/tst_qpainter.cpp | 89 ++++++++++++++++------ 1 file changed, 67 insertions(+), 22 deletions(-) (limited to 'tests/benchmarks/gui') diff --git a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp index 8af9077347..ea08af7608 100644 --- a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp @@ -228,6 +228,7 @@ private: void createPrimitives(); void drawPrimitives_data_helper(bool fancypens); + void drawPixmapImage_data_helper(bool); void fillPrimitives_helper(QPainter *painter, PrimitiveType type, PrimitiveSet *s); QTransform transformForAngle(qreal angle); @@ -608,7 +609,7 @@ void tst_QPainter::drawLine_antialiased_clipped() p.end(); } -void tst_QPainter::drawPixmap_data() +void tst_QPainter::drawPixmapImage_data_helper(bool pixmaps) { QTest::addColumn("sourceFormat"); QTest::addColumn("targetFormat"); @@ -644,32 +645,71 @@ void tst_QPainter::drawPixmap_data() "ARGB8555_pm", "RGB888", "RGB444", - "ARGB4444_pm" + "ARGB4444_pm", + "RGBx8888", + "RGBA8888", + "RGBA8888_pm", + "BGR30", + "A2BGR30_pm", + "RGB30", + "A2RGB30_pm", + "Alpha8", + "Grayscale8", + }; + + const QImage::Format pixmapFormats[] = { + QImage::Format_RGB32, + QImage::Format_ARGB32_Premultiplied, + QImage::Format_RGB16, + QImage::Format_ARGB8565_Premultiplied, + QImage::Format_BGR30, + QImage::Format_Invalid }; - for (int tar=4; tar