mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 05:23:06 +00:00
feat(src/components/camera/MSFunctions): better asserts
This commit is contained in:
parent
cbc8c720ad
commit
2a81d291e1
2 changed files with 10 additions and 5 deletions
|
|
@ -29,7 +29,7 @@
|
|||
#include <QFileInfo>
|
||||
#include <QQuickWindow>
|
||||
|
||||
// =============================================================================
|
||||
// =============================================================================
|
||||
|
||||
struct CameraStateBinder {
|
||||
CameraStateBinder (CameraRenderer *renderer) : m_renderer(renderer) {
|
||||
|
|
|
|||
|
|
@ -25,12 +25,16 @@
|
|||
|
||||
#include <QOpenGLFunctions>
|
||||
|
||||
#define GL_ASSERT() \
|
||||
Q_ASSERT(m_instance->m_q_functions != NULL); \
|
||||
Q_ASSERT(QOpenGLContext::currentContext()->functions() == m_instance->m_q_functions);
|
||||
|
||||
#define GL_CALL(CALL) \
|
||||
Q_ASSERT(QOpenGLContext::currentContext()->functions() == m_instance->m_q_functions && m_instance->m_q_functions != NULL); \
|
||||
GL_ASSERT() \
|
||||
m_instance->m_q_functions->CALL;
|
||||
|
||||
#define GL_CALL_RET(CALL) \
|
||||
Q_ASSERT(QOpenGLContext::currentContext()->functions() == m_instance->m_q_functions && m_instance->m_q_functions != NULL); \
|
||||
GL_ASSERT() \
|
||||
return m_instance->m_q_functions->CALL;
|
||||
|
||||
// =============================================================================
|
||||
|
|
@ -42,11 +46,11 @@ public:
|
|||
~MSFunctions ();
|
||||
|
||||
void bind (QOpenGLFunctions *f) {
|
||||
m_q_functions = f;
|
||||
m_q_functions = f; // Qt functions.
|
||||
}
|
||||
|
||||
OpenGlFunctions *getFunctions () {
|
||||
return m_functions;
|
||||
return m_functions; // Own implementation.
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -217,5 +221,6 @@ private:
|
|||
|
||||
#undef GL_CALL
|
||||
#undef GL_CALL_RET
|
||||
#undef GL_ASSERT
|
||||
|
||||
#endif // MS_FUNCTIONS_H_
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue