summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/gl_context_qt.cpp11
-rw-r--r--src/core/gl_context_qt.h1
-rw-r--r--src/core/gl_surface_qt.cpp4
3 files changed, 16 insertions, 0 deletions
diff --git a/src/core/gl_context_qt.cpp b/src/core/gl_context_qt.cpp
index 9ed1db8ba..954917094 100644
--- a/src/core/gl_context_qt.cpp
+++ b/src/core/gl_context_qt.cpp
@@ -155,6 +155,17 @@ QFunctionPointer GLContextHelper::getGlXGetProcAddress()
return get_proc_address;
}
+QFunctionPointer GLContextHelper::getEglGetProcAddress()
+{
+ QFunctionPointer get_proc_address = nullptr;
+#ifndef QT_NO_OPENGL
+ if (QOpenGLContext *context = qt_gl_global_share_context()) {
+ get_proc_address = context->getProcAddress("eglGetProcAddress");
+ }
+#endif
+ return get_proc_address;
+}
+
QT_END_NAMESPACE
#if defined(USE_OZONE) || defined(OS_WIN)
diff --git a/src/core/gl_context_qt.h b/src/core/gl_context_qt.h
index 8ffdad583..cecceabc9 100644
--- a/src/core/gl_context_qt.h
+++ b/src/core/gl_context_qt.h
@@ -63,6 +63,7 @@ public:
static void* getXDisplay();
static void* getNativeDisplay();
static QFunctionPointer getGlXGetProcAddress();
+ static QFunctionPointer getEglGetProcAddress();
private:
Q_INVOKABLE bool initializeContextOnBrowserThread(gl::GLContext* context, gl::GLSurface* surface, gl::GLContextAttribs attribs);
diff --git a/src/core/gl_surface_qt.cpp b/src/core/gl_surface_qt.cpp
index 7e5792460..4d38d7c25 100644
--- a/src/core/gl_surface_qt.cpp
+++ b/src/core/gl_surface_qt.cpp
@@ -227,6 +227,10 @@ bool InitializeStaticGLBindings(GLImplementation implementation) {
base::GetFunctionPointerFromNativeLibrary(library,
"eglGetProcAddress"));
if (!get_proc_address) {
+ QFunctionPointer address = GLContextHelper::getEglGetProcAddress();
+ get_proc_address = reinterpret_cast<gl::GLGetProcAddressProc>(address);
+ }
+ if (!get_proc_address) {
LOG(ERROR) << "eglGetProcAddress not found.";
base::UnloadNativeLibrary(library);
return false;