Bug 1209612 - Only QueryString with null if supported. r=jmuizelaar, a=lizzard
authorJeff Gilbert <jdashg@gmail.com>
Thu, 12 Nov 2015 12:51:00 +0100
changeset 305506 687f98cac21223f633d2ecec2925ef3a4c17eab8
parent 305505 a8608fc16c09c13e018c6007b9d7c211872bd202
child 305507 b50c13a2d7bb3347656485d2f67fa05f789a4c42
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmuizelaar, lizzard
bugs1209612
milestone44.0a2
Bug 1209612 - Only QueryString with null if supported. r=jmuizelaar, a=lizzard
gfx/gl/GLLibraryEGL.cpp
--- a/gfx/gl/GLLibraryEGL.cpp
+++ b/gfx/gl/GLLibraryEGL.cpp
@@ -506,17 +506,27 @@ GLLibraryEGL::EnsureInitialized(bool for
     return true;
 }
 
 void
 GLLibraryEGL::InitExtensionsFromDisplay(EGLDisplay eglDisplay)
 {
     std::vector<nsCString> driverExtensionList;
 
-    const char* rawExts = (const char*)fQueryString(eglDisplay, LOCAL_EGL_EXTENSIONS);
+    bool canQueryStringWithNull = true;
+#ifdef ANDROID
+    canQueryStringWithNull = false;
+#endif
+
+    const char* rawExts = nullptr;
+
+    if (eglDisplay || canQueryStringWithNull) {
+        rawExts = (const char*)fQueryString(eglDisplay, LOCAL_EGL_EXTENSIONS);
+    }
+
     if (rawExts) {
         nsDependentCString exts(rawExts);
         SplitByChar(exts, ' ', &driverExtensionList);
     } else {
         NS_WARNING("Failed to load EGL extension list!");
     }
 
     const bool shouldDumpExts = GLContext::ShouldDumpExts();