Commit ac7c876b by Jonah Ryan-Davis Committed by Commit Bot

GL: DisplayGLX::makeCurrent should handle drawSurface==0

In this case the draw surface should be unbound, but ANGLE had been skipping this case (and handling it internally). This caused a crash on Linux Intel. Now makeCurrent is actually called on the driver with drawSurface mDummyPbuffer. Bug: chromium:988440 Change-Id: Ifae7a828455eb67e516a47515ec6c24cc36e3c2b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1808719 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent e6582161
...@@ -380,17 +380,15 @@ egl::Error DisplayGLX::makeCurrent(egl::Surface *drawSurface, ...@@ -380,17 +380,15 @@ egl::Error DisplayGLX::makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface, egl::Surface *readSurface,
gl::Context *context) gl::Context *context)
{ {
if (drawSurface) glx::Drawable drawable =
(drawSurface ? GetImplAs<SurfaceGLX>(drawSurface)->getDrawable() : mDummyPbuffer);
if (drawable != mCurrentDrawable)
{ {
glx::Drawable drawable = GetImplAs<SurfaceGLX>(drawSurface)->getDrawable(); if (mGLX.makeCurrent(drawable, mContext) != True)
if (drawable != mCurrentDrawable)
{ {
if (mGLX.makeCurrent(drawable, mContext) != True) return egl::EglContextLost() << "Failed to make the GLX context current";
{
return egl::EglContextLost() << "Failed to make the GLX context current";
}
mCurrentDrawable = drawable;
} }
mCurrentDrawable = drawable;
} }
return DisplayGL::makeCurrent(drawSurface, readSurface, context); return DisplayGL::makeCurrent(drawSurface, readSurface, context);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment