summaryrefslogtreecommitdiffstats
path: root/gfx/gl/GLContextProviderGLX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/gl/GLContextProviderGLX.cpp')
-rw-r--r--gfx/gl/GLContextProviderGLX.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/gfx/gl/GLContextProviderGLX.cpp b/gfx/gl/GLContextProviderGLX.cpp
index 539520a8c..c44b1a9f0 100644
--- a/gfx/gl/GLContextProviderGLX.cpp
+++ b/gfx/gl/GLContextProviderGLX.cpp
@@ -894,20 +894,12 @@ GLContextGLX::~GLContextGLX()
return;
}
- // see bug 659842 comment 76
-#ifdef DEBUG
- bool success =
-#endif
- mGLX->xMakeCurrent(mDisplay, X11None, nullptr);
- MOZ_ASSERT(success,
- "glXMakeCurrent failed to release GL context before we call "
- "glXDestroyContext!");
-
mGLX->xDestroyContext(mDisplay, mContext);
if (mDeleteDrawable) {
mGLX->xDestroyPixmap(mDisplay, mDrawable);
}
+ MOZ_ASSERT(!mOverrideDrawable);
}
@@ -944,6 +936,10 @@ GLContextGLX::MakeCurrentImpl(bool aForce)
// DRI2InvalidateBuffers event before drawing. See bug 1280653.
Unused << XPending(mDisplay);
}
+ if (IsDestroyed()) {
+ MOZ_ALWAYS_TRUE(mGLX->xMakeCurrent(mDisplay, X11None, nullptr));
+ return false; // We did not MakeCurrent mContext, but that's what we wanted!
+ }
succeeded = mGLX->xMakeCurrent(mDisplay, mDrawable, mContext);
NS_ASSERTION(succeeded, "Failed to make GL context current!");
@@ -1017,16 +1013,18 @@ GLContextGLX::GetWSIInfo(nsCString* const out) const
bool
GLContextGLX::OverrideDrawable(GLXDrawable drawable)
{
- if (Screen())
+ if (Screen()) {
Screen()->AssureBlitted();
- Bool result = mGLX->xMakeCurrent(mDisplay, drawable, mContext);
- return result;
+ }
+ mOverrideDrawable = Some(drawable);
+ return MakeCurrent(true);
}
bool
GLContextGLX::RestoreDrawable()
{
- return mGLX->xMakeCurrent(mDisplay, mDrawable, mContext);
+ mOverrideDrawable = Nothing();
+ return MakeCurrent(true);
}
GLContextGLX::GLContextGLX(