diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-20 22:35:36 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-20 22:42:14 +0100 |
commit | c6dbf554496191a0cfe4c8f5dbe8c96031d1445b (patch) | |
tree | 72c14ce62e8de6f6f2273799b7badf445ced07d4 /gfx/gl/GLContext.cpp | |
parent | 722161775b9ec9314d1b02f567e42b83115cf993 (diff) | |
download | uxp-c6dbf554496191a0cfe4c8f5dbe8c96031d1445b.tar.gz |
Issue #1354 - Clear the current context when MakeCurrent() fails.
Diffstat (limited to 'gfx/gl/GLContext.cpp')
-rw-r--r-- | gfx/gl/GLContext.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp index 1515b8627e..3fb87822d4 100644 --- a/gfx/gl/GLContext.cpp +++ b/gfx/gl/GLContext.cpp @@ -578,6 +578,10 @@ GLContext::LoadFeatureSymbols(const char* prefix, bool trygl, const SymLoadStruc bool GLContext::InitWithPrefixImpl(const char* prefix, bool trygl) { + // wglGetProcAddress requires a current context. + if (!MakeCurrent(true)) + return false; + mWorkAroundDriverBugs = gfxPrefs::WorkAroundDriverBugs(); const SymLoadStruct coreSymbols[] = { @@ -714,7 +718,6 @@ GLContext::InitWithPrefixImpl(const char* prefix, bool trygl) //////////////// - MakeCurrent(); MOZ_ASSERT(mProfile != ContextProfile::Unknown); uint32_t version = 0; @@ -2253,13 +2256,11 @@ GLContext::MarkDestroyed() mBlitHelper = nullptr; mReadTexImageHelper = nullptr; - if (MakeCurrent()) { + mIsDestroyed = true; + mSymbols.Zero(); + if (MakeCurrent(true)) { mTexGarbageBin->GLContextTeardown(); - } else { - NS_WARNING("MakeCurrent() failed during MarkDestroyed! Skipping GL object teardown."); } - - mSymbols.Zero(); } #ifdef MOZ_GL_DEBUG |