summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-10-30 12:34:46 (GMT)
committeraxis <qt-info@nokia.com>2009-10-30 12:34:46 (GMT)
commit7a2fbdaaf06e69b1b35c7e5560127ff5cd93f362 (patch)
treef158cbf2c32d046e31473b2d70e462c07c43d122 /src/gui/image
parent5e95f9c3c224b87840e750d4280806a40ed40c92 (diff)
parentda9880eaed0d09338717db1a73db01e6b0ab080d (diff)
downloadQt-7a2fbdaaf06e69b1b35c7e5560127ff5cd93f362.zip
Qt-7a2fbdaaf06e69b1b35c7e5560127ff5cd93f362.tar.gz
Qt-7a2fbdaaf06e69b1b35c7e5560127ff5cd93f362.tar.bz2
Merge branch '4.6-s60' into 4.6
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qpixmap_s60.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index 666d608..7086341 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -684,9 +684,10 @@ void QS60PixmapData::beginDataAccess()
uchar* newBytes = (uchar*)cfbsBitmap->DataAddress();
- if (newBytes == bytes)
- return;
+ TSize size = cfbsBitmap->SizeInPixels();
+ if (newBytes == bytes && image.width() == size.iWidth && image.height() == size.iHeight)
+ return;
bytes = newBytes;
TDisplayMode mode = cfbsBitmap->DisplayMode();
@@ -695,8 +696,6 @@ void QS60PixmapData::beginDataAccess()
if (format == QImage::Format_ARGB32)
format = QImage::Format_ARGB32_Premultiplied; // pixel data is actually in premultiplied format
- TSize size = cfbsBitmap->SizeInPixels();
-
QVector<QRgb> savedColorTable;
if (!image.isNull())
savedColorTable = image.colorTable();
@@ -935,18 +934,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);