summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-07-21 16:42:28 +0200
committerJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-08-03 17:12:02 +0300
commit1d925ee4518ccaa7181bcf96fedcffcb34eeeb1b (patch)
treef4e8520154fcc11ce4de98705ba18cc113d1d634
parentf6e7eb2811c57626d87ba498a96f2702b79730d5 (diff)
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 <simon.hausmann@theqtcompany.com>
-rw-r--r--src/plugins/scenegraph/softwarecontext/pixmaptexture.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/scenegraph/softwarecontext/pixmaptexture.cpp b/src/plugins/scenegraph/softwarecontext/pixmaptexture.cpp
index d3dd747..283a90e 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))
{
}