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
--- 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");
}