diff options
author | Jani Hautakangas <jani.hautakangas@nokia.com> | 2010-10-12 09:41:26 (GMT) |
---|---|---|
committer | Jani Hautakangas <jani.hautakangas@nokia.com> | 2010-10-12 10:54:36 (GMT) |
commit | 71de6cd879f2f79900bda83cc4ba48f6df051d66 (patch) | |
tree | eccaf65b77b19b3c8918195713f1626860ac4fb3 /src | |
parent | edddadd88950f22f6d813e50acdcf2711d3d5a84 (diff) | |
download | Qt-71de6cd879f2f79900bda83cc4ba48f6df051d66.zip Qt-71de6cd879f2f79900bda83cc4ba48f6df051d66.tar.gz Qt-71de6cd879f2f79900bda83cc4ba48f6df051d66.tar.bz2 |
Fix for CFbsBitmap to QPixmap conversion.
Symbian bitmap formats may have different scanline length
when compared to QImage formats. We need to define scanline
length for intermediate QImage when converting from CFbsBitmap
to QPixmap.
Task-number: QTBUG-14218
Reviewed-by: Jason Barron
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qpixmap_s60.cpp | 3 | ||||
-rw-r--r-- | src/openvg/qvg_symbian.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 47249d9..b7c8acb 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -968,11 +968,12 @@ void QS60PixmapData::fromNativeType(void* pixmap, NativeType nativeType) if (needsCopy) { TSize size = sourceBitmap->SizeInPixels(); + int bytesPerLine = sourceBitmap->ScanLineLength(size.iWidth, displayMode); QSymbianBitmapDataAccess da; da.beginDataAccess(sourceBitmap); uchar *bytes = (uchar*)sourceBitmap->DataAddress(); - QImage img = QImage(bytes, size.iWidth, size.iHeight, format); + QImage img = QImage(bytes, size.iWidth, size.iHeight, bytesPerLine, format); img = img.copy(); da.endDataAccess(sourceBitmap); diff --git a/src/openvg/qvg_symbian.cpp b/src/openvg/qvg_symbian.cpp index a9625b2..41b35fc 100644 --- a/src/openvg/qvg_symbian.cpp +++ b/src/openvg/qvg_symbian.cpp @@ -185,10 +185,11 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type) QImage::Format format = qt_TDisplayMode2Format(displayMode); TSize size = bitmap->SizeInPixels(); + int bytesPerLine = bitmap->ScanLineLength(size.iWidth, displayMode); bitmap->BeginDataAccess(); uchar *bytes = (uchar*)bitmap->DataAddress(); - QImage img = QImage(bytes, size.iWidth, size.iHeight, format); + QImage img = QImage(bytes, size.iWidth, size.iHeight, bytesPerLine, format); img = img.copy(); bitmap->EndDataAccess(); |