summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
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:50:33 +0200
commit00ee3688133522f58a2cd0840bb98af88b04fa92 (patch)
tree72ceb04f8c35fe48abe0befb8cc592556868bc49 /src/plugins/platforms
parent4ba25a092065a6422510a9f4afa4fbbabeda686c (diff)
parent89dc1a1865dd8ed277b88a53262b79a93c2ba8dc (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/corelib/text/qstringliteral.h Change-Id: I1665af3ce537471b249def5e080b39bd4105189e
Diffstat (limited to 'src/plugins/platforms')
-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;