From 1d925ee4518ccaa7181bcf96fedcffcb34eeeb1b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 21 Jul 2015 16:42:28 +0200 Subject: turn off image format conversion in PixmapTexture Avoiding the conversion potentially saves memory and conversion time. Also, it guarantees that the pixmap format doesn't change just by assigning it to a texture object. E.g. QtWebEngine relies on that. Task-number: QTBUG-47328 Change-Id: I4dae1492d581ea406cf86906ed0ed2c126252257 Reviewed-by: Simon Hausmann --- src/plugins/scenegraph/softwarecontext/pixmaptexture.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/plugins/scenegraph/softwarecontext/pixmaptexture.cpp') diff --git a/src/plugins/scenegraph/softwarecontext/pixmaptexture.cpp b/src/plugins/scenegraph/softwarecontext/pixmaptexture.cpp index d3dd747a9e..283a90ec5b 100644 --- a/src/plugins/scenegraph/softwarecontext/pixmaptexture.cpp +++ b/src/plugins/scenegraph/softwarecontext/pixmaptexture.cpp @@ -20,7 +20,9 @@ #include "pixmaptexture.h" PixmapTexture::PixmapTexture(const QImage &image) - : m_pixmap(QPixmap::fromImage(image)) + // Prevent pixmap format conversion to reduce memory consumption + // and surprises in calling code. (See QTBUG-47328) + : m_pixmap(QPixmap::fromImage(image, Qt::NoFormatConversion)) { } -- cgit v1.2.3