summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-24 17:30:08 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-24 17:30:08 +0200
commitf9394275f9b1b6e2c5bea01d661ead00809b934f (patch)
treef983e3316b44c406c605d570961f95e09c58757f /src/plugins/platforms/cocoa
parente4ce8d107052a01a8b25097ab243aeccdd636aa7 (diff)
parent9a09af1cb712ede5720141fcc1b5eadef2fe953f (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm11
-rw-r--r--src/plugins/platforms/cocoa/qnsview_drawing.mm31
3 files changed, 8 insertions, 35 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index 72b5a17475..1e46cd2dde 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -162,7 +162,6 @@ public:
Q_NOTIFICATION_HANDLER(NSWindowDidOrderOffScreenNotification) void windowDidOrderOffScreen();
Q_NOTIFICATION_HANDLER(NSWindowDidChangeOcclusionStateNotification) void windowDidChangeOcclusionState();
Q_NOTIFICATION_HANDLER(NSWindowDidChangeScreenNotification) void windowDidChangeScreen();
- Q_NOTIFICATION_HANDLER(NSWindowDidChangeBackingPropertiesNotification) void windowDidChangeBackingProperties();
Q_NOTIFICATION_HANDLER(NSWindowWillCloseNotification) void windowWillClose();
bool windowShouldClose();
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index bac064dfc5..8ff2890ed2 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1259,17 +1259,6 @@ void QCocoaWindow::windowDidChangeScreen()
currentScreen->requestUpdate();
}
}
-/*
- The window's backing scale factor or color space has changed.
-*/
-void QCocoaWindow::windowDidChangeBackingProperties()
-{
- // Ideally we would plumb this thought QPA in a way that lets clients
- // invalidate their own caches, and recreate QBackingStore. For now we
- // trigger an expose, and let QCocoaBackingStore deal with its own
- // buffer invalidation.
- [m_view setNeedsDisplay:YES];
-}
void QCocoaWindow::windowWillClose()
{
diff --git a/src/plugins/platforms/cocoa/qnsview_drawing.mm b/src/plugins/platforms/cocoa/qnsview_drawing.mm
index d2e6f848a0..e72142466b 100644
--- a/src/plugins/platforms/cocoa/qnsview_drawing.mm
+++ b/src/plugins/platforms/cocoa/qnsview_drawing.mm
@@ -173,20 +173,6 @@
}
#endif
-- (void)updateMetalLayerDrawableSize:(CAMetalLayer *)layer
-{
- CGSize drawableSize = layer.bounds.size;
- drawableSize.width *= layer.contentsScale;
- drawableSize.height *= layer.contentsScale;
- layer.drawableSize = drawableSize;
-}
-
-- (void)layoutSublayersOfLayer:(CALayer *)layer
-{
- if ([layer isKindOfClass:CAMetalLayer.class])
- [self updateMetalLayerDrawableSize:static_cast<CAMetalLayer* >(layer)];
-}
-
- (void)displayLayer:(CALayer *)layer
{
if (!NSThread.isMainThread) {
@@ -211,17 +197,16 @@
- (void)viewDidChangeBackingProperties
{
- CALayer *layer = self.layer;
- if (!layer)
- return;
+ qCDebug(lcQpaDrawing) << "Backing properties changed for" << self;
- layer.contentsScale = self.window.backingScaleFactor;
+ if (self.layer)
+ self.layer.contentsScale = self.window.backingScaleFactor;
- // Metal layers must be manually updated on e.g. screen change
- if ([layer isKindOfClass:CAMetalLayer.class]) {
- [self updateMetalLayerDrawableSize:static_cast<CAMetalLayer* >(layer)];
- [self setNeedsDisplay:YES];
- }
+ // Ideally we would plumb this situation through QPA in a way that lets
+ // clients invalidate their own caches, recreate QBackingStore, etc.
+ // For now we trigger an expose, and let QCocoaBackingStore deal with
+ // buffer invalidation internally.
+ [self setNeedsDisplay:YES];
}
@end