diff options
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.h | 1 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 14 |
2 files changed, 13 insertions, 2 deletions
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 22a32c7ceb..72ac3431de 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 |