diff options
author | athenian200 <athenian200@outlook.com> | 2020-01-27 22:59:08 -0600 |
---|---|---|
committer | athenian200 <athenian200@outlook.com> | 2020-01-27 22:59:08 -0600 |
commit | 3c4f414db74b84f7d2a6fb13fd888a47a153699b (patch) | |
tree | ea81fca559849967a79d598a6f460830762ec9ea /gfx/gl/GLContextProviderGLX.cpp | |
parent | 1f8d508258ac5d7d57fc4eb35cac90f28bc8ca03 (diff) | |
parent | c4b0715baaffc541670fd1158557aa7e61e521d3 (diff) | |
download | UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar.gz UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar.lz UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar.xz UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.zip |
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into form-disabled-issue
Diffstat (limited to 'gfx/gl/GLContextProviderGLX.cpp')
-rw-r--r-- | gfx/gl/GLContextProviderGLX.cpp | 24 |
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( |