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 296733 d720ce07c464
parent 296732 7947f1e4ca76
child 296734 4af91393a8f8
push id5314
push usercbook@mozilla.com
push date2015-11-16 16:14 +0000
treeherdermozilla-beta@4af91393a8f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmuizelaar, lizzard
bugs1209612
milestone43.0
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
@@ -473,17 +473,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();