summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap_s60.cpp
diff options
context:
space:
mode:
authorJani Hautakangas <ext-jani.hautakangas@nokia.com>2009-11-11 15:13:36 (GMT)
committerJani Hautakangas <ext-jani.hautakangas@nokia.com>2009-11-11 15:13:36 (GMT)
commit0779fbb16838a5d857665a0d70e30e2ba49cefba (patch)
tree32e38255a154ba5cc21ff57e00e26e7463e2197e /src/gui/image/qpixmap_s60.cpp
parent7209b00f4fdab6c9e388729590937eea2d3888d7 (diff)
downloadQt-0779fbb16838a5d857665a0d70e30e2ba49cefba.zip
Qt-0779fbb16838a5d857665a0d70e30e2ba49cefba.tar.gz
Qt-0779fbb16838a5d857665a0d70e30e2ba49cefba.tar.bz2
Fix to symbian transparent window backing store format.
Symbian semi-transparent window surface needs backing store pixmap in argb32 format. Normally QPixmap contains only rgb32 or argb32_pre pixels. This fix locks semi-transparent window backing store pixmap to argb32 format. Reviewed-by: Shane Kearns
Diffstat (limited to 'src/gui/image/qpixmap_s60.cpp')
-rw-r--r--src/gui/image/qpixmap_s60.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index f7a880c..21415d3 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -349,7 +349,8 @@ QS60PixmapData::QS60PixmapData(PixelType type) : QRasterPixmapData(type),
bitmapDevice(0),
bitmapGc(0),
pengine(0),
- bytes(0)
+ bytes(0),
+ formatLocked(false)
{
}
@@ -425,11 +426,12 @@ void QS60PixmapData::release()
}
/*!
- * Takes ownership of bitmap
+ * Takes ownership of bitmap. Used by window surface
*/
void QS60PixmapData::fromSymbianBitmap(CFbsBitmap* bitmap)
{
cfbsBitmap = bitmap;
+ formatLocked = true;
if(!initSymbianBitmapContext()) {
qWarning("Could not create CBitmapContext");
@@ -693,8 +695,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)
+ // On S60 3.1, premultiplied alpha pixels are stored in a bitmap with 16MA type.
+ // S60 window surface needs backing store pixmap for transparent window in ARGB32 format.
+ // In that case formatLocked is true.
+ if (!formatLocked && format == QImage::Format_ARGB32)
format = QImage::Format_ARGB32_Premultiplied; // pixel data is actually in premultiplied format
QVector<QRgb> savedColorTable;