diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-04-16 07:50:19 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-04-16 08:04:33 (GMT) |
commit | 3eeb244251fd3bbfa3c3f421f1362986100d7587 (patch) | |
tree | 054549bff40929bbc257e518dc6bbad4bc59faca /src/gui/painting/qpaintengine_raster.cpp | |
parent | d6d0b4f2b614453ce2ac96067408e0f3b071de78 (diff) | |
download | Qt-3eeb244251fd3bbfa3c3f421f1362986100d7587.zip Qt-3eeb244251fd3bbfa3c3f421f1362986100d7587.tar.gz Qt-3eeb244251fd3bbfa3c3f421f1362986100d7587.tar.bz2 |
Make subpixel antialiasing of text work on Mac OS X under carbon
Implement the alphaRGBMapForGlyph function and make use of it in
the raster engine. The gamma correction is currently hardcoded to 2.0
which looks very good on two separate displays (iMac and MacBook Pro).
Ideally this would be picked from the system settings or computed
dynamically, but as long as 2.0 works, we'll stick to that.
Reviewed-by: Samuel
Diffstat (limited to 'src/gui/painting/qpaintengine_raster.cpp')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 92160f9..8e3d822 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -509,16 +509,20 @@ bool QRasterPaintEngine::begin(QPaintDevice *device) if (d->mono_surface) d->glyphCacheType = QFontEngineGlyphCache::Raster_Mono; -#ifdef Q_WS_WIN - else if (qt_cleartype_enabled) { +#if defined(Q_WS_WIN) + else if (qt_cleartype_enabled) +#elif defined (Q_WS_MAC) + else if (true) +#else + else if (false) +#endif + { QImage::Format format = static_cast<QImage *>(d->device)->format(); if (format == QImage::Format_ARGB32_Premultiplied || format == QImage::Format_RGB32) d->glyphCacheType = QFontEngineGlyphCache::Raster_RGBMask; else d->glyphCacheType = QFontEngineGlyphCache::Raster_A8; - } -#endif - else + } else d->glyphCacheType = QFontEngineGlyphCache::Raster_A8; setActive(true); |