Bug 719253 - Fennec cannot init EGL libs due to wrong library name. r=glandium,a=blassey
authorOleg Romashin <romaxa@gmail.com>
Fri, 20 Jan 2012 09:18:56 -0500
changeset 85129 47cb704586dc2ac812871b4bdf071f2cd862a7bb
parent 85128 5458543c789dd7c3088ea6870b6509326d6ca72d
child 85130 d9b0a2d392e36ffa64406975fac3bb87cb35a24e
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, blassey
bugs719253
milestone11.0a2
Bug 719253 - Fennec cannot init EGL libs due to wrong library name. r=glandium,a=blassey
gfx/gl/GLContextProviderEGL.cpp
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -64,22 +64,22 @@
 #endif
 
 #if defined(ANDROID)
 /* from widget */
 #if defined(MOZ_WIDGET_ANDROID)
 #include "AndroidBridge.h"
 #endif
 #include <android/log.h>
+#endif
+
 #define EGL_LIB "libEGL.so"
 #define GLES2_LIB "libGLESv2.so"
-#else
-#define EGL_LIB "libEGL.so.1"
-#define GLES2_LIB "libGLESv2.so.2"
-#endif
+#define EGL_LIB1 "libEGL.so.1"
+#define GLES2_LIB2 "libGLESv2.so.2"
 
 typedef void *EGLNativeDisplayType;
 typedef void *EGLNativePixmapType;
 typedef void *EGLNativeWindowType;
 
 #elif defined(XP_WIN)
 
 #include "mozilla/Preferences.h"
@@ -381,16 +381,21 @@ public:
 
             eglFile->Append(NS_LITERAL_STRING("libEGL.dll"));
             eglFile->Load(&mEGLLibrary);
         } while (false);
 #endif
 
         if (!mEGLLibrary) {
             mEGLLibrary = PR_LoadLibrary(EGL_LIB);
+#if defined(XP_UNIX)
+            if (!mEGLLibrary) {
+                mEGLLibrary = PR_LoadLibrary(EGL_LIB1);
+            }
+#endif
         }
 
         if (!mEGLLibrary) {
             NS_WARNING("Couldn't load EGL LIB.");
             return false;
         }
 
 #define SYMBOL(name) \
@@ -745,17 +750,21 @@ public:
 
     GLContextType GetContextType() {
         return ContextTypeEGL;
     }
 
     bool Init()
     {
         if (!OpenLibrary(GLES2_LIB)) {
-            NS_WARNING("Couldn't load EGL LIB.");
+#if defined(XP_UNIX)
+            if (!OpenLibrary(GLES2_LIB2)) {
+                NS_WARNING("Couldn't load EGL LIB.");
+            }
+#endif
             return false;
         }
 
         bool current = MakeCurrent();
         if (!current) {
             gfx::LogFailure(NS_LITERAL_CSTRING(
                 "Couldn't get device attachments for device."));
             return false;