summaryrefslogtreecommitdiff
path: root/gfx/gl/GLContext.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-20 22:35:36 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-20 22:42:14 +0100
commitc6dbf554496191a0cfe4c8f5dbe8c96031d1445b (patch)
tree72c14ce62e8de6f6f2273799b7badf445ced07d4 /gfx/gl/GLContext.cpp
parent722161775b9ec9314d1b02f567e42b83115cf993 (diff)
downloaduxp-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.cpp13
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