diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-09-05 12:18:59 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-09-09 22:13:28 +0000 |
commit | c0e94fa0cd2a2e6216dae5da0dde289fb689d22d (patch) | |
tree | d4def9da2ba6be0cb0352817062247a2192c1f9e /src/plugins/platforms/cocoa/qcocoawindow.mm | |
parent | 85917c4b72a498e86d6dd057a5b6df26c0565fc4 (diff) |
macOS: Use NSOpenGLContext's drawable directly to track active drawable
We don't need a separate QWindow pointer to keep track of the active
window, it's recorded already by the NSOpenGLContext's drawable.
And we don't need to juggle the drawable when the window is hidden,
the drawable is still valid after the window is re-shown, and we
call update on every frame (for now) anyways, which will reconfigure
the drawable if needed.
Change-Id: I199b6c027226dd239c13ecc4aba86986ca09a1eb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 2178f3bf23..1de8577ebe 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -151,9 +151,6 @@ QCocoaWindow::QCocoaWindow(QWindow *win, WId nativeHandle) , m_inSetVisible(false) , m_inSetGeometry(false) , m_inSetStyleMask(false) -#ifndef QT_NO_OPENGL - , m_glContext(nullptr) -#endif , m_menubar(nullptr) , m_needsInvalidateShadow(false) , m_hasModalSession(false) @@ -405,10 +402,6 @@ void QCocoaWindow::setVisible(bool visible) [m_view setHidden:NO]; } else { // qDebug() << "close" << this; -#ifndef QT_NO_OPENGL - if (m_glContext) - m_glContext->windowWasHidden(); -#endif QCocoaEventDispatcher *cocoaEventDispatcher = qobject_cast<QCocoaEventDispatcher *>(QGuiApplication::instance()->eventDispatcher()); QCocoaEventDispatcherPrivate *cocoaEventDispatcherPrivate = nullptr; if (cocoaEventDispatcher) @@ -1336,18 +1329,6 @@ bool QCocoaWindow::windowIsPopupType(Qt::WindowType type) const return ((type & Qt::Popup) == Qt::Popup); } -#ifndef QT_NO_OPENGL -void QCocoaWindow::setCurrentContext(QCocoaGLContext *context) -{ - m_glContext = context; -} - -QCocoaGLContext *QCocoaWindow::currentContext() const -{ - return m_glContext; -} -#endif - /*! Checks if the window is the content view of its immediate NSWindow. |