diff options
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaglcontext.h')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaglcontext.h | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.h b/src/plugins/platforms/cocoa/qcocoaglcontext.h index 0530aa8201..eefb1cd0fb 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.h +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.h @@ -41,6 +41,7 @@ #define QCOCOAGLCONTEXT_H #include <QtCore/QPointer> +#include <QtCore/private/qcore_mac_p.h> #include <qpa/qplatformopenglcontext.h> #include <QtGui/QOpenGLContext> #include <QtGui/QWindow> @@ -52,39 +53,35 @@ QT_BEGIN_NAMESPACE class QCocoaGLContext : public QPlatformOpenGLContext { public: - QCocoaGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, const QVariant &nativeHandle); + QCocoaGLContext(QOpenGLContext *context); ~QCocoaGLContext(); - QSurfaceFormat format() const override; - - void swapBuffers(QPlatformSurface *surface) override; - bool makeCurrent(QPlatformSurface *surface) override; + void swapBuffers(QPlatformSurface *surface) override; void doneCurrent() override; - QFunctionPointer getProcAddress(const char *procName) override; - void update(); - static NSOpenGLPixelFormat *createNSOpenGLPixelFormat(const QSurfaceFormat &format); - NSOpenGLContext *nsOpenGLContext() const; - + QSurfaceFormat format() const override; bool isSharing() const override; bool isValid() const override; - void windowWasHidden(); + NSOpenGLContext *nativeContext() const; - QVariant nativeHandle() const; + QFunctionPointer getProcAddress(const char *procName) override; private: - void setActiveWindow(QWindow *window); + static NSOpenGLPixelFormat *pixelFormatForSurfaceFormat(const QSurfaceFormat &format); + + bool setDrawable(QPlatformSurface *surface); void updateSurfaceFormat(); - NSOpenGLContext *m_context; - NSOpenGLContext *m_shareContext; + NSOpenGLContext *m_context = nil; + NSOpenGLContext *m_shareContext = nil; QSurfaceFormat m_format; - QPointer<QWindow> m_currentWindow; - bool m_didCheckForSoftwareContext; + bool m_didCheckForSoftwareContext = false; + QVarLengthArray<QMacScopedObserver, 3> m_updateObservers; + QAtomicInt m_needsUpdate = false; }; QT_END_NAMESPACE |