diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-03-10 15:11:09 (GMT) |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-03-10 15:11:09 (GMT) |
commit | 433e4380c98b9369a7d55894e9d34f8c87ba06e9 (patch) | |
tree | f9b6c97214607c9d0f7827af34114227b92a5570 /src/gui | |
parent | 3c3176f43f049e0c26e56f04881bd8047e731915 (diff) | |
download | Qt-433e4380c98b9369a7d55894e9d34f8c87ba06e9.zip Qt-433e4380c98b9369a7d55894e9d34f8c87ba06e9.tar.gz Qt-433e4380c98b9369a7d55894e9d34f8c87ba06e9.tar.bz2 |
Fix for fromSymbianCFbsBitmap changing the source data unexpectedly.
Inverting the pixels for bitmaps of mode EGray2 is done in-place,
which is wrong if the bitmap handle was duplicated. Instead, we
need to make a copy. This also means that we cannot treat EGray2
a conversion-less format in openvg, but such images are likely
to be used as masks only, so optimizing just for mere drawing
in case of this format is not really necessary.
Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/image/qvolatileimagedata_symbian.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/image/qvolatileimagedata_symbian.cpp b/src/gui/image/qvolatileimagedata_symbian.cpp index 474d0ef..6e2909b 100644 --- a/src/gui/image/qvolatileimagedata_symbian.cpp +++ b/src/gui/image/qvolatileimagedata_symbian.cpp @@ -392,6 +392,9 @@ void QVolatileImageData::initWithBitmap(CFbsBitmap *source) } else if (needsCopy) { // Rasterize extended and compressed bitmaps. bitmap = rasterizeBitmap(source, EColor16MAP); + } else if (source->DisplayMode() == EGray2) { + // The pixels will be inverted, must make a copy. + bitmap = rasterizeBitmap(source, source->DisplayMode()); } else { // Efficient path: no pixel data copying. Just duplicate. This of course // means the original bitmap's data may get modified, but that's fine |