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.

Fixes: QTBUG-101236
Change-Id: I8e4ee67f53093b7f81e014b28d8a028ba2ddcc47
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 0e90bdbaa43b05a0c0711c78c749bb8379efa755)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Allan Sandfeld Jensen 2022-09-16 15:43:30 +02:00 committed by Qt Cherry-pick Bot
parent db5fc3711b
commit 0459b572b3

View File

@ -5506,6 +5506,7 @@ void tst_QPainter::hdrColors()
QCOMPARE(img.pixelColor(4, 4), color); QCOMPARE(img.pixelColor(4, 4), color);
QImage img2(10, 10, QImage::Format_RGBX32FPx4); 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); QPainter p(&img2);
p.drawImage(0, 0, img); p.drawImage(0, 0, img);