diff options
author | Jani Hautakangas <ext-jani.hautakangas@nokia.com> | 2009-10-28 09:13:08 (GMT) |
---|---|---|
committer | Jani Hautakangas <ext-jani.hautakangas@nokia.com> | 2009-10-28 09:21:59 (GMT) |
commit | 680de3b4bf3c62b2df83797f8cee5789c121bf00 (patch) | |
tree | 3611c8ed52fc4bd7d8b3b8f229c1270190c54d29 /src | |
parent | c5671bcc033e6e519fe8f88b64c108e8d52371fe (diff) | |
download | Qt-680de3b4bf3c62b2df83797f8cee5789c121bf00.zip Qt-680de3b4bf3c62b2df83797f8cee5789c121bf00.tar.gz Qt-680de3b4bf3c62b2df83797f8cee5789c121bf00.tar.bz2 |
Fix EColor16M conversion in QPixmap::fromSymbianCFbsBitmap()
EColor16M is in BGR format so after conversion to QImage RGB
values needs to be swapped.
Reviewed-by: jbarron
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qpixmap_s60.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 666d608..c56e9b7 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -935,18 +935,21 @@ void QS60PixmapData::fromNativeType(void* pixmap, NativeType nativeType) da.beginDataAccess(sourceBitmap); uchar *bytes = (uchar*)sourceBitmap->DataAddress(); QImage img = QImage(bytes, size.iWidth, size.iHeight, format); + img = img.copy(); da.endDataAccess(sourceBitmap); - fromImage(img, Qt::AutoColor); - - if(deleteSourceBitmap) - delete sourceBitmap; - if(displayMode == EGray2) { //Symbian thinks set pixels are white/transparent, Qt thinks they are foreground/solid //So invert mono bitmaps so that masks work correctly. - image.invertPixels(); + img.invertPixels(); + } else if(displayMode == EColor16M) { + img = img.rgbSwapped(); // EColor16M is BGR } + + fromImage(img, Qt::AutoColor); + + if(deleteSourceBitmap) + delete sourceBitmap; } else { CFbsBitmap* duplicate = 0; QT_TRAP_THROWING(duplicate = new (ELeave) CFbsBitmap); |