diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-07-02 23:10:13 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-07-07 14:40:57 +0000 |
commit | 85472b6b02b42ea624e1c00a5fd38c0d2889a731 (patch) | |
tree | a968d6b1e7df234dad747faee36390880656e3bc /src/plugins/platforms/cocoa/qcocoascreen.h | |
parent | b3dc96ef4c0d6387bed819e614b20285b48bcfb7 (diff) |
macOS: Deliver update request via CVDisplayLink if swapInterval > 0
We use GCD for marshaling the display link update over to the main
thread, as Qt requires that the update request is delivered there.
Change-Id: I318a5b8f27dc5094ce71244401308a4044c41b39
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoascreen.h')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoascreen.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoascreen.h b/src/plugins/platforms/cocoa/qcocoascreen.h index 850ccaad7a..afb294240e 100644 --- a/src/plugins/platforms/cocoa/qcocoascreen.h +++ b/src/plugins/platforms/cocoa/qcocoascreen.h @@ -77,6 +77,10 @@ public: NSScreen *nativeScreen() const; void updateGeometry(); + void requestUpdate(); + void deliverUpdateRequests(); + bool isRunningDisplayLink() const; + static QCocoaScreen *primaryScreen(); static CGPoint mapToNative(const QPointF &pos, QCocoaScreen *screen = QCocoaScreen::primaryScreen()); @@ -96,6 +100,10 @@ public: QSizeF m_physicalSize; QCocoaCursor *m_cursor; QList<QPlatformScreen *> m_siblings; + + CVDisplayLinkRef m_displayLink = nullptr; + dispatch_source_t m_displayLinkSource = nullptr; + QAtomicInt m_pendingUpdates; }; #ifndef QT_NO_DEBUG_STREAM |