summaryrefslogtreecommitdiffstats
path: root/gfx/gl/GLContext.cpp
diff options
context:
space:
mode:
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 1515b8627..3fb87822d 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