diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-12-17 14:20:46 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-02 18:40:11 +0100 |
commit | d5d6e0cf9917c36a93668189014f584e533fc1b9 (patch) | |
tree | f4b3ae477ac137010c50655148ad1f80da48b9c5 /src/gui/image/qpixmap_raster.cpp | |
parent | c2e2e0151e51b5870f41c993d4c7f3a3c16e5405 (diff) |
RValue ref version of QPixmap::fromImage()
When converting from a temporary image we can use inplace conversion
since we don't have to worry about changes made to the original.
This should give a speedup in several places where QPixmaps are made
from
the return values of methods returning QImages.
Change-Id: I1835bcf3fc061c4dbbb3d0507ec84178dc49b29b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/image/qpixmap_raster.cpp')
-rw-r--r-- | src/gui/image/qpixmap_raster.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp index f9a017c281..be63430a78 100644 --- a/src/gui/image/qpixmap_raster.cpp +++ b/src/gui/image/qpixmap_raster.cpp @@ -135,11 +135,16 @@ bool QRasterPlatformPixmap::fromData(const uchar *buffer, uint len, const char * void QRasterPlatformPixmap::fromImage(const QImage &sourceImage, Qt::ImageConversionFlags flags) { - Q_UNUSED(flags); QImage image = sourceImage; createPixmapForImage(image, flags, /* inplace = */false); } +void QRasterPlatformPixmap::fromImageInPlace(QImage &sourceImage, + Qt::ImageConversionFlags flags) +{ + createPixmapForImage(sourceImage, flags, /* inplace = */true); +} + void QRasterPlatformPixmap::fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags) { |