diff options
author | Sean Harmer <sean.harmer.qnx@kdab.com> | 2012-05-24 11:03:43 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-25 14:46:04 +0200 |
commit | 49b12d82360ac9602190ff6be93ef0d7b2949055 (patch) | |
tree | 3c40effb04cc587d97be7e586c228d60c88d2527 /src/plugins/platforms/qnx/qqnxglcontext.cpp | |
parent | df1fc82e23b0f4fec0141dcb8cecd1874dd1655c (diff) |
QNX: Rationalise the usage of qDebug() to remove lots of #ifdef's
Change-Id: I097e4af86a6a0941f4fd7e122970f88ba536ab38
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: Andriy Golovnya <andriy.golovnya@googlemail.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxglcontext.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxglcontext.cpp | 59 |
1 files changed, 23 insertions, 36 deletions
diff --git a/src/plugins/platforms/qnx/qqnxglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp index 0b333ea728..593180019d 100644 --- a/src/plugins/platforms/qnx/qqnxglcontext.cpp +++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp @@ -50,6 +50,12 @@ #include <QtGui/QOpenGLContext> #include <QtGui/QScreen> +#ifdef QQNXGLCONTEXT_DEBUG +#define qGLContextDebug qDebug +#else +#define qGLContextDebug QT_NO_QDEBUG_MACRO +#endif + QT_BEGIN_NAMESPACE EGLDisplay QQnxGLContext::ms_eglDisplay = EGL_NO_DISPLAY; @@ -84,9 +90,7 @@ QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext) m_glContext(glContext), m_eglSurface(EGL_NO_SURFACE) { -#if defined(QQNXGLCONTEXT_DEBUG) - qDebug() << Q_FUNC_INFO; -#endif + qGLContextDebug() << Q_FUNC_INFO; QSurfaceFormat format = m_glContext->format(); // Set current rendering API @@ -160,9 +164,7 @@ QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext) QQnxGLContext::~QQnxGLContext() { -#if defined(QQNXGLCONTEXT_DEBUG) - qDebug() << Q_FUNC_INFO; -#endif + qGLContextDebug() << Q_FUNC_INFO; // Cleanup EGL context if it exists if (m_eglContext != EGL_NO_CONTEXT) { @@ -175,9 +177,8 @@ QQnxGLContext::~QQnxGLContext() void QQnxGLContext::initialize() { -#if defined(QQNXGLCONTEXT_DEBUG) - qDebug() << Q_FUNC_INFO; -#endif + qGLContextDebug() << Q_FUNC_INFO; + // Initialize connection to EGL ms_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); if (ms_eglDisplay == EGL_NO_DISPLAY) { @@ -194,18 +195,16 @@ void QQnxGLContext::initialize() void QQnxGLContext::shutdown() { -#if defined(QQNXGLCONTEXT_DEBUG) - qDebug() << Q_FUNC_INFO; -#endif + qGLContextDebug() << Q_FUNC_INFO; + // Close connection to EGL eglTerminate(ms_eglDisplay); } bool QQnxGLContext::makeCurrent(QPlatformSurface *surface) { -#if defined(QQNXGLCONTEXT_DEBUG) - qDebug() << Q_FUNC_INFO; -#endif + qGLContextDebug() << Q_FUNC_INFO; + // Set current rendering API EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API); if (eglResult != EGL_TRUE) { @@ -225,9 +224,8 @@ bool QQnxGLContext::makeCurrent(QPlatformSurface *surface) void QQnxGLContext::doneCurrent() { -#if defined(QQNXGLCONTEXT_DEBUG) - qDebug() << Q_FUNC_INFO; -#endif + qGLContextDebug() << Q_FUNC_INFO; + // set current rendering API EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API); if (eglResult != EGL_TRUE) { @@ -244,9 +242,7 @@ void QQnxGLContext::doneCurrent() void QQnxGLContext::swapBuffers(QPlatformSurface *surface) { Q_UNUSED(surface); -#if defined(QQNXGLCONTEXT_DEBUG) - qDebug() << Q_FUNC_INFO; -#endif + qGLContextDebug() << Q_FUNC_INFO; // Set current rendering API EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API); @@ -263,9 +259,7 @@ void QQnxGLContext::swapBuffers(QPlatformSurface *surface) QFunctionPointer QQnxGLContext::getProcAddress(const QByteArray &procName) { -#if defined(QQNXGLCONTEXT_DEBUG) - qDebug() << Q_FUNC_INFO; -#endif + qGLContextDebug() << Q_FUNC_INFO; // Set current rendering API EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API); @@ -279,9 +273,7 @@ QFunctionPointer QQnxGLContext::getProcAddress(const QByteArray &procName) EGLint *QQnxGLContext::contextAttrs() { -#if defined(QQNXGLCONTEXT_DEBUG) - qDebug() << Q_FUNC_INFO; -#endif + qGLContextDebug() << Q_FUNC_INFO; // Choose EGL settings based on OpenGL version #if defined(QT_OPENGL_ES_2) @@ -294,17 +286,14 @@ EGLint *QQnxGLContext::contextAttrs() bool QQnxGLContext::isCurrent() const { -#if defined(QQNXGLCONTEXT_DEBUG) - qDebug() << Q_FUNC_INFO; -#endif + qGLContextDebug() << Q_FUNC_INFO; return (eglGetCurrentContext() == m_eglContext); } void QQnxGLContext::createSurface(QPlatformSurface *surface) { -#if defined(QQNXGLCONTEXT_DEBUG) - qDebug() << Q_FUNC_INFO; -#endif + qGLContextDebug() << Q_FUNC_INFO; + // Get a pointer to the corresponding platform window QQnxWindow *platformWindow = dynamic_cast<QQnxWindow*>(surface); if (!platformWindow) { @@ -339,9 +328,7 @@ void QQnxGLContext::createSurface(QPlatformSurface *surface) void QQnxGLContext::destroySurface() { -#if defined(QQNXGLCONTEXT_DEBUG) - qDebug() << Q_FUNC_INFO; -#endif + qGLContextDebug() << Q_FUNC_INFO; // Destroy EGL surface if it exists if (m_eglSurface != EGL_NO_SURFACE) { |