macOS: Improve QCocoaGLContext logging
Change-Id: I27d0abe0eb5b0f0ba64b8787b430484c48b131c0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
35da2b87e3
commit
aabf4fbbe9
@ -86,6 +86,10 @@ private:
|
|||||||
QSurfaceFormat m_format;
|
QSurfaceFormat m_format;
|
||||||
QVarLengthArray<QMacNotificationObserver, 3> m_updateObservers;
|
QVarLengthArray<QMacNotificationObserver, 3> m_updateObservers;
|
||||||
QAtomicInt m_needsUpdate = false;
|
QAtomicInt m_needsUpdate = false;
|
||||||
|
|
||||||
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
|
friend QDebug operator<<(QDebug debug, const QCocoaGLContext *screen);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -158,6 +158,8 @@ void QCocoaGLContext::initialize()
|
|||||||
[m_context setValues:&order forParameter:NSOpenGLCPSurfaceOrder];
|
[m_context setValues:&order forParameter:NSOpenGLCPSurfaceOrder];
|
||||||
|
|
||||||
updateSurfaceFormat();
|
updateSurfaceFormat();
|
||||||
|
|
||||||
|
qCDebug(lcQpaOpenGLContext).verbosity(3) << "Created" << this << "based on requested" << context()->format();
|
||||||
}
|
}
|
||||||
|
|
||||||
NSOpenGLPixelFormat *QCocoaGLContext::pixelFormatForSurfaceFormat(const QSurfaceFormat &format)
|
NSOpenGLPixelFormat *QCocoaGLContext::pixelFormatForSurfaceFormat(const QSurfaceFormat &format)
|
||||||
@ -355,7 +357,7 @@ QCocoaGLContext::~QCocoaGLContext()
|
|||||||
|
|
||||||
bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface)
|
bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface)
|
||||||
{
|
{
|
||||||
qCDebug(lcQpaOpenGLContext) << "Making" << m_context << "current"
|
qCDebug(lcQpaOpenGLContext) << "Making" << this << "current"
|
||||||
<< "in" << QThread::currentThread() << "for" << surface;
|
<< "in" << QThread::currentThread() << "for" << surface;
|
||||||
|
|
||||||
Q_ASSERT(surface->surface()->supportsOpenGL());
|
Q_ASSERT(surface->surface()->supportsOpenGL());
|
||||||
@ -555,4 +557,20 @@ QFunctionPointer QCocoaGLContext::getProcAddress(const char *procName)
|
|||||||
return (QFunctionPointer)dlsym(RTLD_DEFAULT, procName);
|
return (QFunctionPointer)dlsym(RTLD_DEFAULT, procName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
|
QDebug operator<<(QDebug debug, const QCocoaGLContext *context)
|
||||||
|
{
|
||||||
|
QDebugStateSaver saver(debug);
|
||||||
|
debug.nospace();
|
||||||
|
debug << "QCocoaGLContext(" << (const void *)context;
|
||||||
|
if (context) {
|
||||||
|
if (debug.verbosity() > QDebug::DefaultVerbosity)
|
||||||
|
debug << ", " << context->format();
|
||||||
|
debug << ", " << context->nativeContext();
|
||||||
|
}
|
||||||
|
debug << ')';
|
||||||
|
return debug;
|
||||||
|
}
|
||||||
|
#endif // !QT_NO_DEBUG_STREAM
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user