From ce8eaf11405f8acd607f29af5b7daeb57b4abb6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Tue, 23 Jun 2009 10:12:28 +0200 Subject: Improve flushing performance in the raster window surface on Mac. Use the display color space for QNativeImage to avoid format conversions. Reviewed-by: Samuel --- src/gui/image/qnativeimage.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/gui/image/qnativeimage.cpp') diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp index bb8f98a991..bfe5dfe247 100644 --- a/src/gui/image/qnativeimage.cpp +++ b/src/gui/image/qnativeimage.cpp @@ -52,6 +52,10 @@ #include #endif +#ifdef Q_WS_MAC +#include +#endif + QT_BEGIN_NAMESPACE #ifdef Q_WS_WIN @@ -225,10 +229,10 @@ QImage::Format QNativeImage::systemFormat() #elif defined(Q_WS_MAC) -QNativeImage::QNativeImage(int width, int height, QImage::Format format, bool /* isTextBuffer */, QWidget *) +QNativeImage::QNativeImage(int width, int height, QImage::Format format, bool /* isTextBuffer */, QWidget *widget) : image(width, height, format) { - cgColorSpace = CGColorSpaceCreateDeviceRGB(); + cgColorSpace = QCoreGraphicsPaintEngine::macDisplayColorSpace(widget); uint cgflags = kCGImageAlphaNoneSkipFirst; #ifdef kCGBitmapByteOrder32Host //only needed because CGImage.h added symbols in the minor version -- cgit v1.2.3