diff options
author | axis <qt-info@nokia.com> | 2009-10-28 15:09:45 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-10-28 15:21:09 (GMT) |
commit | f360555f3c7ded3c729ce972fbd65f035876b1b4 (patch) | |
tree | b310da76aa865a7d0e7c1bfff079bce0c0d4e598 /src/gui/image | |
parent | 8007617f784fcad76661efbb2ce9ee7393946e02 (diff) | |
download | Qt-f360555f3c7ded3c729ce972fbd65f035876b1b4.zip Qt-f360555f3c7ded3c729ce972fbd65f035876b1b4.tar.gz Qt-f360555f3c7ded3c729ce972fbd65f035876b1b4.tar.bz2 |
Fixed crash/drawing artifacts on rotation change on Symbian.
On every beginDataAccess on the pixmap data, we checked the value of
the pointer to the bits and only updated the image if the pointer had
changed. However, we didn't take into account that the pointer could
be the same, even though the dimensions were different, since
malloc() could return the same memory area. This would lead to
painting into an image that had the wrong dimensions, which again led
to either crashes or image shearing. Fixed by checking the dimensions
before deciding to update the image.
Task: QTBUG-4815
RevBy: Jason Barron
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qpixmap_s60.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index c56e9b7..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(); |