Bug 1267879 - Fix WGL robustness. - r=jrmuizel
authorJeff Gilbert <jgilbert@mozilla.com>
Fri, 10 Jun 2016 17:44:15 -0700
changeset 303434 bba7d02cdb8c475d04f078ef004fd6e6fcfa7fcd
parent 303433 99a891cdb4fee4c9cd54290ef4e1366e71f418de
child 303435 b2272d35d5f8bf3b43d4adcfd4e9391d7037b37a
push id30388
push usercbook@mozilla.com
push dateSat, 02 Jul 2016 09:15:23 +0000
treeherdermozilla-central@39dffbba7642 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1267879
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1267879 - Fix WGL robustness. - r=jrmuizel MozReview-Commit-ID: IpstmnnGM0N
gfx/gl/GLContextProviderWGL.cpp
--- a/gfx/gl/GLContextProviderWGL.cpp
+++ b/gfx/gl/GLContextProviderWGL.cpp
@@ -199,17 +199,17 @@ WGLLibrary::EnsureInitialized()
     };
 
     if (GLLibraryLoader::LoadSymbols(mOGLLibrary, &extensionsSymbols[0], lookupFunc))
     {
         const char* extString = fGetExtensionsString(mWindowDC);
         MOZ_ASSERT(extString);
         MOZ_ASSERT(HasExtension(extString, "WGL_ARB_extensions_string"));
 
-        if (HasExtension(extString, "WGL_ARB_context_create")) {
+        if (HasExtension(extString, "WGL_ARB_create_context")) {
             if (GLLibraryLoader::LoadSymbols(mOGLLibrary, &robustnessSymbols[0], lookupFunc)) {
                 if (HasExtension(extString, "WGL_ARB_create_context_robustness")) {
                     mHasRobustness = true;
                 }
             } else {
                 NS_ERROR("WGL supports ARB_create_context without supplying its functions.");
                 fCreateContextAttribs = nullptr;
             }
@@ -548,18 +548,18 @@ CreatePBufferOffscreenContext(CreateCont
 
     HGLRC context;
     if (wgl.HasRobustness()) {
         int attribs[] = {
             LOCAL_WGL_CONTEXT_FLAGS_ARB, LOCAL_WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB,
             LOCAL_WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB, LOCAL_WGL_LOSE_CONTEXT_ON_RESET_ARB,
             0
         };
-
-        context = wgl.fCreateContextAttribs(pbdc, aShareContext->Context(), attribs);
+        const HGLRC shareHandle = (aShareContext ? aShareContext->Context() : 0);
+        context = wgl.fCreateContextAttribs(pbdc, shareHandle, attribs);
     } else {
         context = wgl.fCreateContext(pbdc);
         if (context && aShareContext) {
             if (!wgl.fShareLists(aShareContext->Context(), context)) {
                 wgl.fDeleteContext(context);
                 context = nullptr;
                 printf_stderr("ERROR - creating pbuffer context failed because wglShareLists returned FALSE");
             }