summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-02-12 13:42:42 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-02-25 09:46:55 +0100
commitc2bec047e281d949015ecd27daf2ba2d51b21526 (patch)
tree37f6f78331ef651c954a5d6917b1eb9171ba1ff3 /src
parente3ebbca5406ac02909823a07bfe6ae4db768f3da (diff)
And fix handling and test of QImage::fill(uint) as well
Only RGB444 and RGB666 were treated slighlty different from the rest, but the test had a few additional mistakes. Pick-to: 6.1 6.0 5.15 Change-Id: I4728b4036affedfffce8bca5c1e7be3869344fbe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qimage.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 15fb928ce7..33c12993d7 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -1709,10 +1709,14 @@ void QImage::fill(uint pixel)
w, d->height, d->bytes_per_line);
return;
} else if (d->depth == 16) {
+ if (d->format == Format_RGB444)
+ pixel |= 0xf000;
qt_rectfill<quint16>(reinterpret_cast<quint16*>(d->data), pixel,
0, 0, d->width, d->height, d->bytes_per_line);
return;
} else if (d->depth == 24) {
+ if (d->format == Format_RGB666)
+ pixel |= 0xfc0000;
qt_rectfill<quint24>(reinterpret_cast<quint24*>(d->data), pixel,
0, 0, d->width, d->height, d->bytes_per_line);
return;