diff options
author | Jens Bache-Wiig <jens.bache-wiig@nokia.com> | 2009-06-25 14:35:55 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jens.bache-wiig@nokia.com> | 2009-06-25 14:37:04 (GMT) |
commit | db24e82b6b74be303492f186a45d784fcd84fdc6 (patch) | |
tree | 13b3358df74d262a97356c5759a77debec4051bc /src/gui/painting | |
parent | 47c9e7b1b3551ff6dbe71590461a45ae398a9501 (diff) | |
download | Qt-db24e82b6b74be303492f186a45d784fcd84fdc6.zip Qt-db24e82b6b74be303492f186a45d784fcd84fdc6.tar.gz Qt-db24e82b6b74be303492f186a45d784fcd84fdc6.tar.bz2 |
Improved support for DPI on Mac and Vista/7
This significantly improves the support for
higher DPI-values on these platforms by
ensuring that common pixelmetrics are
scaled accordingly. In addition we mark all
Qt apps as DPI-aware on Windows 7 by calling
SetProcessDPIAware. We also changed the
way we draw pixmaps on the mac paintengine
when using dpi scaling > 1 to ensure smooth
pixmap scaling.
Reviewed-by: nrc
Task-id: 242417
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qpaintengine_mac.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/painting/qpaintengine_mac.cpp b/src/gui/painting/qpaintengine_mac.cpp index 793460f..f5f1bba 100644 --- a/src/gui/painting/qpaintengine_mac.cpp +++ b/src/gui/painting/qpaintengine_mac.cpp @@ -1381,8 +1381,13 @@ QCoreGraphicsPaintEngine::updateRenderHints(QPainter::RenderHints hints) { Q_D(QCoreGraphicsPaintEngine); CGContextSetShouldAntialias(d->hd, hints & QPainter::Antialiasing); - CGContextSetInterpolationQuality(d->hd, (hints & QPainter::SmoothPixmapTransform) ? - kCGInterpolationHigh : kCGInterpolationNone); + static const CGFloat ScaleFactor = qt_mac_get_scalefactor(); + if (ScaleFactor > 1.) { + CGContextSetInterpolationQuality(d->hd, kCGInterpolationHigh); + } else { + CGContextSetInterpolationQuality(d->hd, (hints & QPainter::SmoothPixmapTransform) ? + kCGInterpolationHigh : kCGInterpolationNone); + } CGContextSetShouldSmoothFonts(d->hd, hints & QPainter::TextAntialiasing); } |