diff options
author | Rafael Roquetto <rafael.roquetto.qnx@kdab.com> | 2013-05-18 09:19:38 -0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-23 12:49:39 +0200 |
commit | 02311c07cf98d5a39a05a81aac5d5fc318f2d822 (patch) | |
tree | 87f8d5ec07b9f3344079fed9d3f8289b181f8be1 /src/plugins/platforms/qnx/qqnxglcontext.cpp | |
parent | c3488be438a80256f0f699efd7ee796939b83c17 (diff) |
QNX: normalize braces
Change-Id: I05f140a0626e543535cc74c6f737be9be1e27a5d
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxglcontext.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxglcontext.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/plugins/platforms/qnx/qqnxglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp index f77bb73614..005b6d272a 100644 --- a/src/plugins/platforms/qnx/qqnxglcontext.cpp +++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp @@ -96,9 +96,8 @@ QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext) // Set current rendering API EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API); - if (eglResult != EGL_TRUE) { + if (eglResult != EGL_TRUE) qFatal("QQNX: failed to set EGL API, err=%d", eglGetError()); - } // Get colour channel sizes from window format int alphaSize = format.alphaBufferSize(); @@ -149,9 +148,8 @@ QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext) // Select EGL config based on requested window format m_eglConfig = q_configFromGLFormat(ms_eglDisplay, format); - if (m_eglConfig == 0) { + if (m_eglConfig == 0) qFatal("QQnxGLContext: failed to find EGL config"); - } m_eglContext = eglCreateContext(ms_eglDisplay, m_eglConfig, EGL_NO_CONTEXT, contextAttrs()); if (m_eglContext == EGL_NO_CONTEXT) { @@ -168,9 +166,8 @@ QQnxGLContext::~QQnxGLContext() qGLContextDebug() << Q_FUNC_INFO; // Cleanup EGL context if it exists - if (m_eglContext != EGL_NO_CONTEXT) { + if (m_eglContext != EGL_NO_CONTEXT) eglDestroyContext(ms_eglDisplay, m_eglContext); - } // Cleanup EGL surface if it exists destroySurface(); @@ -216,9 +213,8 @@ bool QQnxGLContext::makeCurrent(QPlatformSurface *surface) // Set current rendering API EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API); - if (eglResult != EGL_TRUE) { + if (eglResult != EGL_TRUE) qFatal("QQnxGLContext: failed to set EGL API, err=%d", eglGetError()); - } if (m_newSurfaceRequested.testAndSetOrdered(true, false)) { qGLContextDebug() << "New EGL surface requested"; @@ -241,15 +237,13 @@ void QQnxGLContext::doneCurrent() // set current rendering API EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API); - if (eglResult != EGL_TRUE) { + if (eglResult != EGL_TRUE) qFatal("QQNX: failed to set EGL API, err=%d", eglGetError()); - } // clear curent EGL context and unbind EGL surface eglResult = eglMakeCurrent(ms_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - if (eglResult != EGL_TRUE) { + if (eglResult != EGL_TRUE) qFatal("QQNX: failed to clear current EGL context, err=%d", eglGetError()); - } } void QQnxGLContext::swapBuffers(QPlatformSurface *surface) @@ -259,15 +253,13 @@ void QQnxGLContext::swapBuffers(QPlatformSurface *surface) // Set current rendering API EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API); - if (eglResult != EGL_TRUE) { + if (eglResult != EGL_TRUE) qFatal("QQNX: failed to set EGL API, err=%d", eglGetError()); - } // Post EGL surface to window eglResult = eglSwapBuffers(ms_eglDisplay, m_eglSurface); - if (eglResult != EGL_TRUE) { + if (eglResult != EGL_TRUE) qFatal("QQNX: failed to swap EGL buffers, err=%d", eglGetError()); - } } QFunctionPointer QQnxGLContext::getProcAddress(const QByteArray &procName) @@ -276,9 +268,8 @@ QFunctionPointer QQnxGLContext::getProcAddress(const QByteArray &procName) // Set current rendering API EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API); - if (eglResult != EGL_TRUE) { + if (eglResult != EGL_TRUE) qFatal("QQNX: failed to set EGL API, err=%d", eglGetError()); - } // Lookup EGL extension function pointer return static_cast<QFunctionPointer>(eglGetProcAddress(procName.constData())); @@ -309,9 +300,8 @@ void QQnxGLContext::createSurface(QPlatformSurface *surface) // Get a pointer to the corresponding platform window QQnxWindow *platformWindow = dynamic_cast<QQnxWindow*>(surface); - if (!platformWindow) { + if (!platformWindow) qFatal("QQNX: unable to create EGLSurface without a QQnxWindow"); - } // Link the window and context platformWindow->setPlatformOpenGLContext(this); |