summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Sørvig <msorvig@trolltech.com>2009-06-23 08:12:28 (GMT)
committerMorten Sørvig <msorvig@trolltech.com>2009-06-23 08:12:28 (GMT)
commitce8eaf11405f8acd607f29af5b7daeb57b4abb6d (patch)
treec1ae295e5c7afcd0c1d9a77f54d56704c6df2e70
parent281f9ec0ce98da53a7b2103aac4d17e47bdea8a5 (diff)
downloadQt-ce8eaf11405f8acd607f29af5b7daeb57b4abb6d.zip
Qt-ce8eaf11405f8acd607f29af5b7daeb57b4abb6d.tar.gz
Qt-ce8eaf11405f8acd607f29af5b7daeb57b4abb6d.tar.bz2
Improve flushing performance in the raster window surface on Mac.
Use the display color space for QNativeImage to avoid format conversions. Reviewed-by: Samuel
-rw-r--r--src/gui/image/qnativeimage.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp
index bb8f98a..bfe5dfe 100644
--- a/src/gui/image/qnativeimage.cpp
+++ b/src/gui/image/qnativeimage.cpp
@@ -52,6 +52,10 @@
#include <qwidget.h>
#endif
+#ifdef Q_WS_MAC
+#include <private/qpaintengine_mac_p.h>
+#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