Bug 1688668 - EGL should attempt to load libGL before libGLES. r=jgilbert

Not all configurations have both libGL and libGLES present, and this
matches the order which glxtest loads them. Without this, a user might
pass glxtest, which says they can use EGL, but then not have libGLES on
the library path.

Differential Revision: https://phabricator.services.mozilla.com/D102936
This commit is contained in:
Andrew Osmond 2021-02-27 21:25:16 +00:00
parent 6a27002564
commit 3bd304e55e

View File

@ -317,6 +317,8 @@ static std::shared_ptr<EglDisplay> GetAndInitDisplayForAccelANGLE(
#if defined(XP_UNIX)
# define GLES2_LIB "libGLESv2.so"
# define GLES2_LIB2 "libGLESv2.so.2"
# define GL_LIB "libGL.so"
# define GL_LIB2 "libGL.so.1"
#elif defined(XP_WIN)
# define GLES2_LIB "libGLESv2.dll"
#else
@ -401,6 +403,18 @@ bool GLLibraryEGL::Init(nsACString* const out_failureId) {
}
# endif
# ifdef GL_LIB
if (!mGLLibrary) {
mGLLibrary = PR_LoadLibrary(GL_LIB);
}
# endif
# ifdef GL_LIB2
if (!mGLLibrary) {
mGLLibrary = PR_LoadLibrary(GL_LIB2);
}
# endif
if (!mGLLibrary) {
mGLLibrary = PR_LoadLibrary(GLES2_LIB);
}