macOS: Don't create QMacCGContext when printing

We adopt the context of the print session, so the code is not needed,
and would just produce a warning since QMacCGContext didn't know what
to do about the printer paint device.

Change-Id: I9ac079f5cb5d98022045632592d0e375710eecc3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Tor Arne Vestbø 2020-03-02 16:08:05 +01:00
parent 5d9d3ff326
commit 048f0a00fa

View File

@ -394,6 +394,8 @@ QCoreGraphicsPaintEngine::begin(QPaintDevice *pdev)
d->cosmeticPenSize = 1; d->cosmeticPenSize = 1;
d->current.clipEnabled = false; d->current.clipEnabled = false;
d->pixelSize = QPoint(1,1); d->pixelSize = QPoint(1,1);
if (pdev->devType() != QInternal::Printer) {
QMacCGContext ctx(pdev); QMacCGContext ctx(pdev);
d->hd = CGContextRetain(ctx); d->hd = CGContextRetain(ctx);
if (d->hd) { if (d->hd) {
@ -405,6 +407,7 @@ QCoreGraphicsPaintEngine::begin(QPaintDevice *pdev)
} }
d->setClip(nullptr); //clear the context's clipping d->setClip(nullptr); //clear the context's clipping
} }
}
setActive(true); setActive(true);