Fix in-place conversion of certain QImage formats
In the copying/transcription of the generic converter to the generic in-place converter, a test for Format_RGB32 destination format was mistakenly replaced with test of source format. The result was that a suboptimal pixel store function was selected, and the resulting image data could end up with non-0xff in the unused alpha field. Task-number: QTBUG-132051 Change-Id: If3ebf5fdd7ab6e377c8ad479ea38ce665f922b7c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 0ace5ba0357b1614b47cb38a16f4afb2fe8e62db) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 4d009678ce1f8ca63d62fdbb09c80ec2f80811b9)
This commit is contained in:
parent
bde58519bb
commit
933128d266
@ -385,7 +385,7 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im
|
||||
!destLayout->hasAlphaChannel && destLayout->storeFromRGB32) {
|
||||
// Avoid unnecessary premultiply and unpremultiply when converting from unpremultiplied src format.
|
||||
fetch = qPixelLayouts[qt_toPremultipliedFormat(data->format)].fetchToARGB32PM;
|
||||
if (data->format == QImage::Format_RGB32)
|
||||
if (dst_format == QImage::Format_RGB32)
|
||||
store = storeRGB32FromARGB32;
|
||||
else
|
||||
store = destLayout->storeFromRGB32;
|
||||
|
Loading…
x
Reference in New Issue
Block a user