summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2018-07-20 12:48:20 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-07-30 20:01:35 +0000
commitb80a0ef3c1af16ba74c2b9e931c18266362ce926 (patch)
treebee8750699e713494e498d6f9d877d994e40c31f
parent392db86c1fe64e5a6b79dfcf1764c7d16825c84d (diff)
Fix odd looking byte convertion in pdfium wrapper
On little-endian rgba8888 is abgr32, however we still swapped bytes resulting in argb32. Use simply correct format from beginning, which avoids swapping. Change-Id: I6578d6dfe626d5afdcefcae6dea3ca44b23d4412 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/core/printing/pdfium_document_wrapper_qt.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/printing/pdfium_document_wrapper_qt.cpp b/src/core/printing/pdfium_document_wrapper_qt.cpp
index 2a94e15d4..47c207a8a 100644
--- a/src/core/printing/pdfium_document_wrapper_qt.cpp
+++ b/src/core/printing/pdfium_document_wrapper_qt.cpp
@@ -88,7 +88,7 @@ private:
if (targetHeight <= 0)
targetHeight = m_height;
- QImage image(targetWidth, targetHeight, QImage::Format_RGBA8888);
+ QImage image(targetWidth, targetHeight, QImage::Format_ARGB32);
Q_ASSERT(!image.isNull());
image.fill(0xFFFFFFFF);
@@ -102,9 +102,7 @@ private:
0, 0);
FPDFBitmap_Destroy(bitmap);
bitmap = nullptr;
-
- // Map BGRA to RGBA as PDFium currently does not support RGBA bitmaps directly
- return std::move(image).rgbSwapped();
+ return std::move(image);
}
private: