diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-02-12 13:42:42 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-02-25 11:22:53 +0000 |
commit | 4a57534f67fad9e28b22aaabaf7e590a4fa40122 (patch) | |
tree | 685eb38ddf62ef44d3287226febcab6bc010365e /src/gui/image | |
parent | 723077eb3529810aa3b99d8c06f9b81a586763c9 (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.
Change-Id: I4728b4036affedfffce8bca5c1e7be3869344fbe
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit c2bec047e281d949015ecd27daf2ba2d51b21526)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qimage.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index c6175ac84f..2c356dba16 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; |