diff options
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); |