diff options
author | Jani Hautakangas <ext-jani.hautakangas@nokia.com> | 2009-11-11 15:13:36 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-11-18 05:57:10 (GMT) |
commit | d6d5dd13b4464676898409ac505d9ab2aef09d8d (patch) | |
tree | 2d5f567a2621a7deea9c0c1e7ece240894349aae | |
parent | 9adab252dceef088b0da3f5dd345772771339db8 (diff) | |
download | Qt-d6d5dd13b4464676898409ac505d9ab2aef09d8d.zip Qt-d6d5dd13b4464676898409ac505d9ab2aef09d8d.tar.gz Qt-d6d5dd13b4464676898409ac505d9ab2aef09d8d.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
(cherry picked from commit 0779fbb16838a5d857665a0d70e30e2ba49cefba)
-rw-r--r-- | src/gui/image/qpixmap_s60.cpp | 12 | ||||
-rw-r--r-- | src/gui/image/qpixmap_s60_p.h | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 9d783dd..17baa50 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; diff --git a/src/gui/image/qpixmap_s60_p.h b/src/gui/image/qpixmap_s60_p.h index b23961a..b1b5824 100644 --- a/src/gui/image/qpixmap_s60_p.h +++ b/src/gui/image/qpixmap_s60_p.h @@ -118,6 +118,8 @@ private: QPaintEngine *pengine; uchar* bytes; + bool formatLocked; + friend class QPixmap; friend class QS60WindowSurface; friend class QS60PaintEngine; |