From 51451ea2693b6761110b827249527947d6a9beb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 2 Aug 2018 13:14:50 +0200 Subject: macOS: Add more logging to QCocoaGLContext Change-Id: I6e93934b466f86b7607c9ad30c4c28a9c0f40fd7 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoaglcontext.mm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/cocoa') diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index b84360b7ae..655c40e345 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -76,7 +76,7 @@ static inline QByteArray getGlString(GLenum param) QT_BEGIN_NAMESPACE -Q_LOGGING_CATEGORY(lcQpaOpenGLContext, "qt.qpa.openglcontext"); +Q_LOGGING_CATEGORY(lcQpaOpenGLContext, "qt.qpa.openglcontext", QtWarningMsg); QCocoaGLContext::QCocoaGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, const QVariant &nativeHandle) @@ -367,6 +367,9 @@ QCocoaGLContext::~QCocoaGLContext() bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface) { + qCDebug(lcQpaOpenGLContext) << "Making" << m_context << "current" + << "in" << QThread::currentThread() << "for" << surface; + Q_ASSERT(surface->surface()->supportsOpenGL()); QMacAutoReleasePool pool; @@ -431,11 +434,15 @@ static QMutex s_contextMutex; void QCocoaGLContext::update() { QMutexLocker locker(&s_contextMutex); + qCInfo(lcQpaOpenGLContext) << "Updating" << m_context << "for" << m_context.view; [m_context update]; } void QCocoaGLContext::swapBuffers(QPlatformSurface *surface) { + qCDebug(lcQpaOpenGLContext) << "Swapping" << m_context + << "in" << QThread::currentThread() << "to" << surface; + if (surface->surface()->surfaceClass() == QSurface::Offscreen) return; // Nothing to do @@ -451,6 +458,9 @@ void QCocoaGLContext::swapBuffers(QPlatformSurface *surface) void QCocoaGLContext::doneCurrent() { + qCDebug(lcQpaOpenGLContext) << "Clearing current context" + << [NSOpenGLContext currentContext] << "in" << QThread::currentThread(); + if (m_currentWindow && m_currentWindow.data()->handle()) static_cast(m_currentWindow.data()->handle())->setCurrentContext(nullptr); -- cgit v1.2.3