diff options
author | Michal Klocek <michal.klocek@qt.io> | 2018-11-12 12:05:18 +0100 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2018-11-13 11:33:34 +0000 |
commit | 40bd9e91108045f1e393f4c98d19cd8df4ee73ce (patch) | |
tree | 2c439bb0e4f1c3d9ae15152592a3376e952f2e52 /src/core/ozone/gl_ozone_glx_qt.cpp | |
parent | 4d6de2ba36ff4fe17b0e1c8ee7de4f63e2778c9e (diff) |
Add missing refactoring for glxGetProcAddress
Commit 9ad3c7aa fixed regression, however refactoring
which took place 9397251b is missing.
Task-number: QTBUG-70696
Task-number: QTBUG-71742
Change-Id: I4ff3f5fbbd14996478299f51a3d766d2fa1a7017
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core/ozone/gl_ozone_glx_qt.cpp')
-rw-r--r-- | src/core/ozone/gl_ozone_glx_qt.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/core/ozone/gl_ozone_glx_qt.cpp b/src/core/ozone/gl_ozone_glx_qt.cpp index 2e7a28a0e..e3a4f4708 100644 --- a/src/core/ozone/gl_ozone_glx_qt.cpp +++ b/src/core/ozone/gl_ozone_glx_qt.cpp @@ -44,18 +44,12 @@ #include <QGuiApplication> #include "gl_ozone_glx_qt.h" #include "gl_surface_glx_qt.h" +#include "gl_context_qt.h" #include "ui/gl/gl_context_glx.h" #include "ui/gl/gl_gl_api_implementation.h" #include "ui/gl/gl_glx_api_implementation.h" #include <dlfcn.h> -#ifndef QT_NO_OPENGL -#include <QOpenGLContext> -QT_BEGIN_NAMESPACE -Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); -QT_END_NAMESPACE -#endif - namespace ui { bool GLOzoneGLXQt::InitializeGLOneOffPlatform() { @@ -79,16 +73,12 @@ bool GLOzoneGLXQt::InitializeStaticGLBindings( reinterpret_cast<gl::GLGetProcAddressProc>( 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<gl::GLGetProcAddressProc>( - context->getProcAddress("glXGetProcAddress")); - } + QFunctionPointer address = GLContextHelper::getGlXGetProcAddress(); + get_proc_address = reinterpret_cast<gl::GLGetProcAddressProc>(address); } -#endif + if (!get_proc_address) { LOG(ERROR) << "glxGetProcAddress not found."; base::UnloadNativeLibrary(library); |