summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/cocoa/qpaintengine_mac.mm21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/plugins/platforms/cocoa/qpaintengine_mac.mm b/src/plugins/platforms/cocoa/qpaintengine_mac.mm
index 00b2267f0d..df71f76644 100644
--- a/src/plugins/platforms/cocoa/qpaintengine_mac.mm
+++ b/src/plugins/platforms/cocoa/qpaintengine_mac.mm
@@ -394,16 +394,19 @@ QCoreGraphicsPaintEngine::begin(QPaintDevice *pdev)
d->cosmeticPenSize = 1;
d->current.clipEnabled = false;
d->pixelSize = QPoint(1,1);
- QMacCGContext ctx(pdev);
- d->hd = CGContextRetain(ctx);
- if (d->hd) {
- d->saveGraphicsState();
- d->orig_xform = CGContextGetCTM(d->hd);
- if (d->shading) {
- CGShadingRelease(d->shading);
- d->shading = nullptr;
+
+ if (pdev->devType() != QInternal::Printer) {
+ QMacCGContext ctx(pdev);
+ d->hd = CGContextRetain(ctx);
+ if (d->hd) {
+ d->saveGraphicsState();
+ d->orig_xform = CGContextGetCTM(d->hd);
+ if (d->shading) {
+ CGShadingRelease(d->shading);
+ d->shading = nullptr;
+ }
+ d->setClip(nullptr); //clear the context's clipping
}
- d->setClip(nullptr); //clear the context's clipping
}
setActive(true);