Fix flaky FP32x4 test

The composition implementation may act unexpectedly on Inf or NaN input
values. This change avoid those values, without changing the current
implementation.

Pick-to: 6.4
Fixes: QTBUG-101236
Change-Id: I8e4ee67f53093b7f81e014b28d8a028ba2ddcc47
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2022-09-16 15:43:30 +02:00
parent 864fbd6582
commit 0e90bdbaa4

View File

@ -5506,6 +5506,7 @@ void tst_QPainter::hdrColors()
QCOMPARE(img.pixelColor(4, 4), color);
QImage img2(10, 10, QImage::Format_RGBX32FPx4);
img2.fill(Qt::black); // fill to avoid random FP values like Inf which can break SourceOver composition
{
QPainter p(&img2);
p.drawImage(0, 0, img);