summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2018-07-11 14:17:13 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-07-11 21:24:15 +0000
commit5fbe7fe2f9fef3f9430c468e3e0dd3898d3012c1 (patch)
treeb41261b958e0d1e932bf4ed66665e9bb482568fe
parentc864129af8ff6157a6c9a5a532e01a1ee69e98ce (diff)
Simplify BGR -> RGB conversion in PdfiumPageWrapperQt
QImage has an effective implementation for this conversion. Change-Id: I6c015226868fc1e56ef6029b77eb8750dd19b459 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/core/printing/pdfium_document_wrapper_qt.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/core/printing/pdfium_document_wrapper_qt.cpp b/src/core/printing/pdfium_document_wrapper_qt.cpp
index 422cafdea..2a94e15d4 100644
--- a/src/core/printing/pdfium_document_wrapper_qt.cpp
+++ b/src/core/printing/pdfium_document_wrapper_qt.cpp
@@ -104,14 +104,7 @@ private:
bitmap = nullptr;
// Map BGRA to RGBA as PDFium currently does not support RGBA bitmaps directly
- for (int i = 0; i < image.height(); i++) {
- uchar *pixels = image.scanLine(i);
- for (int j = 0; j < image.width(); j++) {
- qSwap(pixels[0], pixels[2]);
- pixels += 4;
- }
- }
- return image;
+ return std::move(image).rgbSwapped();
}
private: