summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-01 10:22:17 (GMT)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-01 10:22:17 (GMT)
commit735caf214e233751cb767214488e0d36931a5b0e (patch)
treefadbbd48f2758f02644cdc5e0a4831b801165459 /src/gui
parent3e52e093f36b9cc1810509a2829c7fffd10aea4f (diff)
downloadQt-735caf214e233751cb767214488e0d36931a5b0e.zip
Qt-735caf214e233751cb767214488e0d36931a5b0e.tar.gz
Qt-735caf214e233751cb767214488e0d36931a5b0e.tar.bz2
Have QVolatileImage backed by a bitmap in all cases.
The behavior now matches the raster (s60) pixmap: A bitmap is created immediately when constructing from a QImage. This is needed to reduce the heap usage of applications (by getting rid of the QImage as early as possible). Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/image/qvolatileimagedata_symbian.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gui/image/qvolatileimagedata_symbian.cpp b/src/gui/image/qvolatileimagedata_symbian.cpp
index d9c2ad4..474d0ef 100644
--- a/src/gui/image/qvolatileimagedata_symbian.cpp
+++ b/src/gui/image/qvolatileimagedata_symbian.cpp
@@ -248,10 +248,10 @@ QVolatileImageData::QVolatileImageData(const QImage &sourceImage)
: next(0), prev(0), bitmap(0), pengine(0)
{
registerImageData(this);
- // Try being optimal: Defer the bitmap creation and pixel data copying
- // to ensureBitmap() which will be called when there is a real need for
- // the bitmap.
image = sourceImage;
+ // The following is not mandatory, but we do it here to have a bitmap
+ // created always in order to reduce local heap usage.
+ ensureBitmap();
}
QVolatileImageData::QVolatileImageData(void *nativeImage, void *nativeMask)
@@ -462,8 +462,6 @@ void QVolatileImageData::ensureImage()
void QVolatileImageData::ensureBitmap()
{
- // Creates the bitmap from the image if not yet done. This case can happen
- // only if we were constructed from a QImage. Otherwise this is a no-op.
if (!bitmap && !image.isNull()) {
bitmap = imageToBitmap(image);
updateImage();