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 <gabriel.dedietrich@qt.io>
This commit is contained in:
Tor Arne Vestbø 2016-12-20 14:28:23 +01:00
parent b9edbb5d54
commit 8533c94a24

View File

@ -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);
}