summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qwindowsurface_raster.cpp
diff options
context:
space:
mode:
authorFabien Freling <fabien.freling@nokia.com>2010-07-22 14:15:55 (GMT)
committerFabien Freling <fabien.freling@nokia.com>2010-07-22 14:15:55 (GMT)
commitc8bb76ec0b19da9e24512852dc8b00461e1a1b7b (patch)
treef33da7a7097c8ab24903938f4862dcc3bac23ff7 /src/gui/painting/qwindowsurface_raster.cpp
parentdf6549d1b95af017305744af04a7bb3b10025660 (diff)
downloadQt-c8bb76ec0b19da9e24512852dc8b00461e1a1b7b.zip
Qt-c8bb76ec0b19da9e24512852dc8b00461e1a1b7b.tar.gz
Qt-c8bb76ec0b19da9e24512852dc8b00461e1a1b7b.tar.bz2
Fix the CGContext on Mac OS X. Sometimes we got
a bad context, resulting in wrong paintings. It also unify the raster engine behavior among platforms. Reviewed-by: Jason Barron
Diffstat (limited to 'src/gui/painting/qwindowsurface_raster.cpp')
-rw-r--r--src/gui/painting/qwindowsurface_raster.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp
index f3e1e4e..6a2cb1e 100644
--- a/src/gui/painting/qwindowsurface_raster.cpp
+++ b/src/gui/painting/qwindowsurface_raster.cpp
@@ -248,10 +248,6 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi
#ifdef Q_WS_MAC
-// qDebug() << "Flushing" << widget << rgn << offset;
-
-// d->image->image.save("flush.png");
-
Q_UNUSED(offset);
// Get a context for the widget.
#ifndef QT_MAC_USE_COCOA
@@ -282,23 +278,19 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi
CGImageRef subImage = CGImageCreateWithImageInRect(image, area);
qt_mac_drawCGImage(context, &area, subImage);
+
CGImageRelease(subImage);
CGImageRelease(image);
-// CGSize size = { d->image->image.width(), d->image->image.height() };
-// CGLayerRef layer = CGLayerCreateWithContext(d->image->cg, size, 0);
-// CGPoint pt = { 0, 0 };
-// CGContextDrawLayerAtPoint(context, pt, layer);
-// CGLayerRelease(layer);
-
- // Restore context.
- CGContextRestoreGState(context);
#ifndef QT_MAC_USE_COCOA
QDEndCGContext(port, &context);
#else
CGContextFlush(context);
#endif
+ // Restore context.
+ CGContextRestoreGState(context);
+
#endif // Q_WS_MAC
#ifdef Q_OS_SYMBIAN