From 8533c94a244b7ed14dcfaac69b512901fe10737e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 20 Dec 2016 14:28:23 +0100 Subject: [PATCH] macOS: Take DPR into account when creating CGContexts for a QPixmap Missing logic when refactoring image manipulation methods into QtGui in c52bb030907. Task-number: QTBUG-57723 Change-Id: I7b55d4451d35faf5fd794daa0b80acbd712f30cd Reviewed-by: Gabriel de Dietrich --- src/gui/painting/qcoregraphics.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/painting/qcoregraphics.mm b/src/gui/painting/qcoregraphics.mm index 466b18d59be..804c40ecbb8 100644 --- a/src/gui/painting/qcoregraphics.mm +++ b/src/gui/painting/qcoregraphics.mm @@ -495,6 +495,8 @@ QMacCGContext::QMacCGContext(QPaintDevice *paintDevice) : context(0) context = CGBitmapContextCreate(image->bits(), image->width(), image->height(), 8, image->bytesPerLine(), colorspace, flags); CGContextTranslateCTM(context, 0, image->height()); + qreal devicePixelRatio = paintDevice->devicePixelRatioF(); + CGContextScaleCTM(context, devicePixelRatio, devicePixelRatio); CGContextScaleCTM(context, 1, -1); }