diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-07-22 13:45:58 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-07-22 14:54:16 +0200 |
commit | b0d0a2680afffe02713ee4110c7996ee423c1d1e (patch) | |
tree | d30bee40cc384d79afc5f1044351b1a5bc5d299c /src/gui/image/qpixmap_raster.cpp | |
parent | 4cedc55327d79aeee18c602fa0822283b27a74e9 (diff) |
QPixmap::fromImage() should detach when changing QImage format
When QPixmap::fromImage() detects an ARGB32 image with only opaque
pixels it will do a conversion where it only changes the advertised
format of the image. This conversion was lacking a check to see if it
the QImage was shared before doing so, which this patch adds.
Task-number: QTBUG-40282
Change-Id: I3acf221b76735637cef04c2104a33f87e5f09d54
Reviewed-by: Andreas Löw <andreas@code-and-web.de>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui/image/qpixmap_raster.cpp')
-rw-r--r-- | src/gui/image/qpixmap_raster.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp index d879a5cb61..639650dd89 100644 --- a/src/gui/image/qpixmap_raster.cpp +++ b/src/gui/image/qpixmap_raster.cpp @@ -343,6 +343,7 @@ void QRasterPlatformPixmap::createPixmapForImage(QImage &sourceImage, Qt::ImageC if (format == QImage::Format_RGB32 && (sourceImage.format() == QImage::Format_ARGB32 || sourceImage.format() == QImage::Format_ARGB32_Premultiplied)) { + inPlace = inPlace && sourceImage.isDetached(); image = sourceImage; if (!inPlace) image.detach(); |