diff options
Diffstat (limited to 'src/core/ozone/gl_ozone_egl_qt.cpp')
-rw-r--r-- | src/core/ozone/gl_ozone_egl_qt.cpp | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/src/core/ozone/gl_ozone_egl_qt.cpp b/src/core/ozone/gl_ozone_egl_qt.cpp index c692920cf..a8b7cdfe4 100644 --- a/src/core/ozone/gl_ozone_egl_qt.cpp +++ b/src/core/ozone/gl_ozone_egl_qt.cpp @@ -38,32 +38,21 @@ ****************************************************************************/ #if defined(USE_OZONE) -#include "gl_ozone_egl_qt.h" #include "gl_context_qt.h" +#include "gl_ozone_egl_qt.h" #include "gl_surface_egl_qt.h" + #include "base/files/file_path.h" #include "base/native_library.h" -#include "gl_context_qt.h" -#include "gl_ozone_egl_qt.h" #include "ui/gl/gl_context_egl.h" #include "ui/gl/gl_implementation.h" #include "ui/gl/gl_surface.h" #include "ui/gl/init/gl_factory.h" #include "ui/gl/init/gl_initializer.h" - #include <EGL/egl.h> #include <dlfcn.h> -#include <QtGui/qtgui-config.h> - -#if QT_CONFIG(opengl) -#include <QOpenGLContext> -QT_BEGIN_NAMESPACE -Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); -QT_END_NAMESPACE -#endif - namespace ui { base::NativeLibrary LoadLibrary(const base::FilePath& filename) { @@ -88,15 +77,11 @@ bool GLOzoneEGLQt::LoadGLES2Bindings(gl::GLImplementation /*implementation*/) reinterpret_cast<gl::GLGetProcAddressProc>( base::GetFunctionPointerFromNativeLibrary(eglgles2Library, "eglGetProcAddress")); -#if QT_CONFIG(opengl) if (!get_proc_address) { // QTBUG-63341 most likely libgles2 not linked with libegl -> fallback to qpa - if (QOpenGLContext *context = qt_gl_global_share_context()) { - get_proc_address = reinterpret_cast<gl::GLGetProcAddressProc>( - context->getProcAddress("eglGetProcAddress")); - } + QFunctionPointer address = GLContextHelper::getEglGetProcAddress(); + get_proc_address = reinterpret_cast<gl::GLGetProcAddressProc>(address); } -#endif if (!get_proc_address) { LOG(ERROR) << "eglGetProcAddress not found."; @@ -142,14 +127,11 @@ scoped_refptr<gl::GLSurface> GLOzoneEGLQt::CreateOffscreenGLSurface(const gfx::S return nullptr; } -intptr_t GLOzoneEGLQt::GetNativeDisplay() +gl::EGLDisplayPlatform GLOzoneEGLQt::GetNativeDisplay() { static void *display = GLContextHelper::getNativeDisplay(); - - if (display) - return reinterpret_cast<intptr_t>(display); - - return reinterpret_cast<intptr_t>(EGL_DEFAULT_DISPLAY); + static gl::EGLDisplayPlatform platform(display ? reinterpret_cast<intptr_t>(display) : EGL_DEFAULT_DISPLAY); + return platform; } } // namespace ui |