summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-08-02 13:14:50 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-08-03 22:50:22 +0000
commit51451ea2693b6761110b827249527947d6a9beb9 (patch)
tree041316e31e4006a6cf5594cd392522d6dff853fc /src/plugins/platforms/cocoa
parentf8b17a297e41f4c0d0656c58c25a0060f2555f97 (diff)
macOS: Add more logging to QCocoaGLContext
Change-Id: I6e93934b466f86b7607c9ad30c4c28a9c0f40fd7 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm12
1 files changed, 11 insertions, 1 deletions
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<QCocoaWindow *>(m_currentWindow.data()->handle())->setCurrentContext(nullptr);