summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcocoaview_mac.mm
diff options
context:
space:
mode:
authorFabien Freling <fabien.freling@nokia.com>2010-10-08 16:37:25 (GMT)
committerFabien Freling <fabien.freling@nokia.com>2010-10-08 16:37:59 (GMT)
commit1966b88611bb45d18d586847eeb3597d6e022eb7 (patch)
tree0bba3169a8bc44761686fd967f1cb25e4beca97a /src/gui/kernel/qcocoaview_mac.mm
parent392ecc76cdbcef37ee492400a1b783106a37ad36 (diff)
downloadQt-1966b88611bb45d18d586847eeb3597d6e022eb7.zip
Qt-1966b88611bb45d18d586847eeb3597d6e022eb7.tar.gz
Qt-1966b88611bb45d18d586847eeb3597d6e022eb7.tar.bz2
Experimental support of the unified toolbar with
the raster engine on Mac OS X. Task-number: QTBUG-12615 Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/gui/kernel/qcocoaview_mac.mm')
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 8576f52..2016d40 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -534,7 +534,7 @@ static int qCocoaViewCount = 0;
return;
// We use a different graphics system.
- if (QApplicationPrivate::graphicsSystem() != 0) {
+ if (QApplicationPrivate::graphicsSystem() != 0 && !qwidgetprivate->isInUnifiedToolbar) {
// Qt handles the painting occuring inside the window.
// Cocoa also keeps track of all widgets as NSView and therefore might
@@ -558,6 +558,15 @@ static int qCocoaViewCount = 0;
CGContextRef cg = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
qwidgetprivate->hd = cg;
+
+ // We steal the CGContext for flushing in the unified toolbar with the raster engine.
+ if (QApplicationPrivate::graphicsSystem() != 0 && qwidgetprivate->isInUnifiedToolbar) {
+ qwidgetprivate->cgContext = cg;
+ qwidgetprivate->hasOwnContext = true;
+ qwidgetprivate->unifiedSurface->flush(qwidget, qwidgetprivate->ut_rg, qwidgetprivate->ut_pt);
+ return;
+ }
+
CGContextSaveGState(cg);
if (qwidget->isVisible() && qwidget->updatesEnabled()) { //process the actual paint event.