summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-27 01:00:12 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-04-27 13:56:59 +0200
commitceaf23b361a44759892def4270b243fac56db8ba (patch)
tree23814782b402602105f06f6aff09ac16be805048 /src/plugins/platforms/cocoa
parent31ec0c8e71d67b9cbcf4809010b36ca3107fe661 (diff)
parent00ee3688133522f58a2cd0840bb98af88b04fa92 (diff)
Merge "Merge remote-tracking branch 'origin/5.15' into dev"
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.mm6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
index c734be09b6..97bb4e8bed 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
@@ -536,8 +536,10 @@ void QCALayerBackingStore::flush(QWindow *flushedWindow, const QRegion &region,
flushedView.layer.contentsScale = m_buffers.back()->devicePixelRatio();
}
+ const bool isSingleBuffered = window()->format().swapBehavior() == QSurfaceFormat::SingleBuffer;
+
id backBufferSurface = (__bridge id)m_buffers.back()->surface();
- if (flushedView.layer.contents == backBufferSurface) {
+ if (!isSingleBuffered && flushedView.layer.contents == backBufferSurface) {
// We've managed to paint to the back buffer again before Core Animation had time
// to flush the transaction and persist the layer changes to the window server, or
// we've been asked to flush without painting anything. The layer already knows about
@@ -554,7 +556,7 @@ void QCALayerBackingStore::flush(QWindow *flushedWindow, const QRegion &region,
// with other pending view and layer updates.
flushedView.window.viewsNeedDisplay = YES;
- if (window()->format().swapBehavior() == QSurfaceFormat::SingleBuffer) {
+ if (isSingleBuffered) {
// The private API [CALayer reloadValueForKeyPath:@"contents"] would be preferable,
// but barring any side effects or performance issues we opt for the hammer for now.
flushedView.layer.contents = nil;