summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-26 21:43:25 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-26 21:43:25 +0200
commit06bd93c4acf49fc24408a60ebdf7a46caf02f9b3 (patch)
treeeedbdaa40fbf20bb99187084dd9edf14f73f05bd /src/plugins/platforms/cocoa
parentbafad505a0adb21b819f7617e5e802bf2d52fd54 (diff)
parent41a7d74385eece725435159ca021151e871bf116 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: src/plugins/platforms/ios/qiosmessagedialog.mm Change-Id: Icfbf55c3215ec088e552d0b42a5c94d04b17c65f
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm5
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h1
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm14
3 files changed, 18 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index 628357eb39..ccb11f80f1 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -330,6 +330,11 @@ void QCocoaGLContext::updateSurfaceFormat()
[pixelFormat release];
+ GLint swapInterval = -1;
+ [m_context getValues:&swapInterval forParameter:NSOpenGLCPSwapInterval];
+ if (swapInterval >= 0)
+ m_format.setSwapInterval(swapInterval);
+
// Restore the original context
CGLSetCurrentContext(oldContext);
}
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index 02ae64a58e..963b29ebbb 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -101,6 +101,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
- (void)setMaskRegion:(const QRegion *)region;
- (void)invalidateWindowShadowIfNeeded;
- (void)drawRect:(NSRect)dirtyRect;
+- (void)drawBackingStoreUsingCoreGraphics:(NSRect)dirtyRect;
- (void)updateGeometry;
- (void)notifyWindowStateChanged:(Qt::WindowState)newState;
- (void)windowNotification : (NSNotification *) windowNotification;
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 4aa5bbef03..6f4375b251 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -569,6 +569,18 @@ static bool _q_dontOverrideCtrlLMB = false;
if (m_platformWindow->m_drawContentBorderGradient)
NSDrawWindowBackground(dirtyRect);
+ if (m_backingStore)
+ [self drawBackingStoreUsingCoreGraphics:dirtyRect];
+
+ [self invalidateWindowShadowIfNeeded];
+}
+
+// Draws the backing store content to the QNSView using Core Graphics.
+// This function assumes that the QNSView is in a configuration that
+// supports Core Graphics, such as "classic" mode or layer mode with
+// the default layer.
+- (void)drawBackingStoreUsingCoreGraphics:(NSRect)dirtyRect
+{
if (!m_backingStore)
return;
@@ -623,8 +635,6 @@ static bool _q_dontOverrideCtrlLMB = false;
CGImageRelease(cleanImg);
CGImageRelease(subMask);
CGImageRelease(bsCGImage);
-
- [self invalidateWindowShadowIfNeeded];
}
- (BOOL) isFlipped