summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qvolatileimagedata_symbian.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-10 17:11:09 +0200
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-10 17:11:09 +0200
commit433e4380c98b9369a7d55894e9d34f8c87ba06e9 (patch)
treef9b6c97214607c9d0f7827af34114227b92a5570 /src/gui/image/qvolatileimagedata_symbian.cpp
parent3c3176f43f049e0c26e56f04881bd8047e731915 (diff)
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/image/qvolatileimagedata_symbian.cpp')
-rw-r--r--src/gui/image/qvolatileimagedata_symbian.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/image/qvolatileimagedata_symbian.cpp b/src/gui/image/qvolatileimagedata_symbian.cpp
index 474d0ef172..6e2909bec3 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