From 9ad3c7aa8c8cd2917191b0b90d048d7d8fcebab5 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 1 Nov 2018 12:45:29 +0100 Subject: Add missing fallback for glxGetProcAddress This fallback was added in 5.11, however fell out somehow during ozone change. Fixes: QTBUG-70696 Change-Id: I68d12842e2283a25db64035e57d5a19323b4e6c0 Reviewed-by: Alexandru Croitor --- src/core/ozone/gl_ozone_glx_qt.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/ozone/gl_ozone_glx_qt.cpp b/src/core/ozone/gl_ozone_glx_qt.cpp index 9a0fea7c7..2e7a28a0e 100644 --- a/src/core/ozone/gl_ozone_glx_qt.cpp +++ b/src/core/ozone/gl_ozone_glx_qt.cpp @@ -41,7 +41,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - +#include #include "gl_ozone_glx_qt.h" #include "gl_surface_glx_qt.h" #include "ui/gl/gl_context_glx.h" @@ -49,6 +49,13 @@ #include "ui/gl/gl_glx_api_implementation.h" #include +#ifndef QT_NO_OPENGL +#include +QT_BEGIN_NAMESPACE +Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); +QT_END_NAMESPACE +#endif + namespace ui { bool GLOzoneGLXQt::InitializeGLOneOffPlatform() { @@ -72,6 +79,16 @@ bool GLOzoneGLXQt::InitializeStaticGLBindings( reinterpret_cast( base::GetFunctionPointerFromNativeLibrary(library, "glXGetProcAddress")); + +#ifndef QT_NO_OPENGL + if (!get_proc_address) { + // glx handle not loaded, fallback to qpa + if (QOpenGLContext *context = qt_gl_global_share_context()) { + get_proc_address = reinterpret_cast( + context->getProcAddress("glXGetProcAddress")); + } + } +#endif if (!get_proc_address) { LOG(ERROR) << "glxGetProcAddress not found."; base::UnloadNativeLibrary(library); -- cgit v1.2.3