summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthew Cattell <matthew.cattell@nokia.com>2011-05-02 09:26:05 (GMT)
committerMatthew Cattell <matthew.cattell@nokia.com>2011-05-02 10:43:49 (GMT)
commit18122b473ecbd85ba953f70743b1756358bf7c0c (patch)
tree8a2f6b0a8847e461c367d5fea4b0dbc9c5928617 /src
parent903cd489d77a7a432c1d5127e238382f42f6e89f (diff)
downloadQt-18122b473ecbd85ba953f70743b1756358bf7c0c.zip
Qt-18122b473ecbd85ba953f70743b1756358bf7c0c.tar.gz
Qt-18122b473ecbd85ba953f70743b1756358bf7c0c.tar.bz2
Fixed bug in QPdfEngine::addImage causing mono images to be made 32 bit
Regression from 4.5 causing performance and size degradation. Task-number: QTBUG-18997 Reviewed-by: Samuel
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qprintengine_pdf.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/painting/qprintengine_pdf.cpp b/src/gui/painting/qprintengine_pdf.cpp
index b7f5160..353869f 100644
--- a/src/gui/painting/qprintengine_pdf.cpp
+++ b/src/gui/painting/qprintengine_pdf.cpp
@@ -534,7 +534,10 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, qint64 serial_n
QImage image = img;
QImage::Format format = image.format();
- if (image.depth() == 1 && *bitmap && img.colorTable().size() == 0) {
+ if (image.depth() == 1 && *bitmap && img.colorTable().size() == 2
+ && img.colorTable().at(0) == QColor(Qt::black).rgba()
+ && img.colorTable().at(1) == QColor(Qt::white).rgba())
+ {
if (format == QImage::Format_MonoLSB)
image = image.convertToFormat(QImage::Format_Mono);
format = QImage::Format_Mono;