summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-10-22 04:57:29 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-10-22 04:57:29 (GMT)
commite7955a49b59a8c2568d1dcabaf6e72aca8a26bb0 (patch)
tree30510f83c40606273020198597c5f25d85205059 /src/gui/image
parent3be273fc751624fab078878904ad3cb483cd141f (diff)
parent61836f454fd49286bce038c386eb8921b88450da (diff)
downloadQt-e7955a49b59a8c2568d1dcabaf6e72aca8a26bb0.zip
Qt-e7955a49b59a8c2568d1dcabaf6e72aca8a26bb0.tar.gz
Qt-e7955a49b59a8c2568d1dcabaf6e72aca8a26bb0.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Conflicts: src/gui/painting/qtextureglyphcache.cpp
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qpixmap_s60.cpp19
-rw-r--r--src/gui/image/qpixmapcache.cpp1
2 files changed, 13 insertions, 7 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index 9ae8d72..666d608 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -496,11 +496,12 @@ void QS60PixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags
mode = EColor16MU;
break;
case QImage::Format_ARGB32_Premultiplied:
-#if !defined(__SERIES60_31__) && !defined(__S60_32__)
- mode = EColor16MAP;
- break;
-#endif
- destFormat = QImage::Format_ARGB32;
+ if (S60->supportsPremultipliedAlpha) {
+ mode = Q_SYMBIAN_ECOLOR16MAP;
+ break;
+ } else {
+ destFormat = QImage::Format_ARGB32;
+ }
// Fall through intended
case QImage::Format_ARGB32:
mode = EColor16MA;
@@ -690,6 +691,10 @@ void QS60PixmapData::beginDataAccess()
bytes = newBytes;
TDisplayMode mode = cfbsBitmap->DisplayMode();
QImage::Format format = qt_TDisplayMode2Format(mode);
+ //on S60 3.1, premultiplied alpha pixels are stored in a bitmap with 16MA type
+ if (format == QImage::Format_ARGB32)
+ format = QImage::Format_ARGB32_Premultiplied; // pixel data is actually in premultiplied format
+
TSize size = cfbsBitmap->SizeInPixels();
QVector<QRgb> savedColorTable;
@@ -794,8 +799,8 @@ void* QS60PixmapData::toNativeType(NativeType type)
bool needsCopy = false;
QSysInfo::SymbianVersion symbianVersion = QSysInfo::symbianVersion();
- if (symbianVersion == QSysInfo::SV_9_2 || symbianVersion == QSysInfo::SV_9_3) {
- // Convert argb32_premultiplied to argb32 since Symbian 9.2 and Symbian 9.3 do
+ if (!(S60->supportsPremultipliedAlpha)) {
+ // Convert argb32_premultiplied to argb32 since Symbian 9.2 does
// not support premultipied format.
if (image.format() == QImage::Format_ARGB32_Premultiplied) {
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index f12d397..b0b7d72 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -221,6 +221,7 @@ QPMCache::QPMCache()
}
QPMCache::~QPMCache()
{
+ clear();
free(keyArray);
}