diff options
author | Michal Klocek <michal.klocek@qt.io> | 2021-05-28 07:34:52 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2021-05-28 16:57:48 +0200 |
commit | 0cf6ec804ea78dbf0121524934cdabd093f4d64a (patch) | |
tree | b1ea5c1a14adcf838abfd6ffeab8511705942b70 /src/core/ozone | |
parent | 52ef57128f948cfb66c46daea0e81b9fa0657a8d (diff) |
Fix compliation without xcb-glx
Change-Id: Ibfc51d1937f42264de0eeb1abacb8999d21fe3dc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/ozone')
-rw-r--r-- | src/core/ozone/gl_share_context_qt.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/core/ozone/gl_share_context_qt.cpp b/src/core/ozone/gl_share_context_qt.cpp index a17321455..f6b9aa63f 100644 --- a/src/core/ozone/gl_share_context_qt.cpp +++ b/src/core/ozone/gl_share_context_qt.cpp @@ -57,24 +57,24 @@ QtShareGLContext::QtShareGLContext(QOpenGLContext *qtContext) #if QT_CONFIG(opengl) QOpenGLContext *context = QOpenGLContext::globalShareContext(); #if defined(Q_OS_MACOS) - auto *ctx = context->nativeInterface<QNativeInterface::QCocoaGLContext>(); - if (ctx) - m_handle = cglContext(ctx->nativeContext()); + auto *mac_ctx = context->nativeInterface<QNativeInterface::QCocoaGLContext>(); + if (mac_ctx) + m_handle = cglContext(mac_ctx->nativeContext()); #endif #if defined(Q_OS_WIN) - auto *ctx = context->nativeInterface<QNativeInterface::QWGLContext>(); + auto *win_ctx = context->nativeInterface<QNativeInterface::QWGLContext>(); + if (win_ctx && !m_handle) + m_handle = (void *)win_ctx->nativeContext(); #endif -#if defined(Q_OS_LINUX) - auto *ctx = context->nativeInterface<QNativeInterface::QGLXContext>(); +#if QT_CONFIG(xcb_glx_plugin) + auto *glx_ctx = context->nativeInterface<QNativeInterface::QGLXContext>(); + if (glx_ctx && !m_handle) + m_handle = (void *)glx_ctx->nativeContext(); #endif - if (ctx && !m_handle) - m_handle = (void *)ctx->nativeContext(); #if QT_CONFIG(egl) - if (!m_handle) { - auto *ctx = context->nativeInterface<QNativeInterface::QEGLContext>(); - if (ctx) - m_handle = (void *)ctx->nativeContext(); - } + auto *egl_ctx = context->nativeInterface<QNativeInterface::QEGLContext>(); + if (egl_ctx && !m_handle) + m_handle = (void *)egl_ctx->nativeContext(); #endif if (!m_handle) qFatal("Could not get handle for shared contex"); |