Bug 1267879 - r?jrmuizel - Fix WGL robustness. draft
authorJeff Gilbert <jdashg@gmail.com>
Fri, 20 May 2016 15:32:54 -0700
changeset 369262 1e37e22155f1c334145ad2546eaa69b95642f2ca
parent 368911 1806d405c8715949b39fa3a4fc142d14a60df590
child 369263 69e965dee11a3179dbcc2fd348126ac06a4c81f3
push id18816
push userjgilbert@mozilla.com
push dateSat, 21 May 2016 00:54:33 +0000
reviewersjrmuizel
bugs1267879
milestone49.0a1
Bug 1267879 - r?jrmuizel - Fix WGL robustness. From 2fbb818c78f0a8093f2fa061cb04d610badb87d9 Mon Sep 17 00:00:00 2001 --- gfx/gl/GLContextProviderWGL.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) MozReview-Commit-ID: FaeA0Vkg4EF
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;
             }
@@ -556,18 +556,18 @@ CreatePBufferOffscreenContext(const IntS
 
     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");
             }