Cocoa: Add drawBackingStoreUsingCoreGraphics
drawRect is a general “repaint now” function, which we should handle also for OpenGL content. Make that clearer by moving the implementation details of drawing the raster backing store using CoreGraphics to a separate function. Behavior change: Call invalidateWindowShadowIfNeeded also for the OpenGL case. Change-Id: I158ebef548e063f826db2dc708c14ab1d784b095 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>bb10
parent
0deb0796a4
commit
3bd5876c89
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue