Commit df33d561 by Geoff Lang Committed by Commit Bot

EGL: Respect eglMakeCurrent with a null context.

Our context virtualization code would try to optimize this case and leave the current context bound when possible. This has the side effect of leaving the current surface bound too, even if it was deleted. During Chrome's window resizing, it deletes the window, calls eglMakeCurrent with null and then recreates the window. This causes an error because the window still exists because it was left current in ANGLE. Bug: chromium:1167718 Change-Id: I857be88be48dfa9c0dd9173f235e155e727e3014 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2637717Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 2ebff7f2
...@@ -392,12 +392,11 @@ egl::Error DisplayAndroid::makeCurrent(egl::Display *display, ...@@ -392,12 +392,11 @@ egl::Error DisplayAndroid::makeCurrent(egl::Display *display,
return DisplayGL::makeCurrent(display, drawSurface, readSurface, context); return DisplayGL::makeCurrent(display, drawSurface, readSurface, context);
} }
// The context should never change when context virtualization is being used, even when a null // The context should never change when context virtualization is being used unless binding a
// context is being bound. // null context.
if (mVirtualizedContexts) if (mVirtualizedContexts && newContext != EGL_NO_CONTEXT)
{ {
ASSERT(newContext == EGL_NO_CONTEXT || currentContext.context == EGL_NO_CONTEXT || ASSERT(currentContext.context == EGL_NO_CONTEXT || newContext == currentContext.context);
newContext == currentContext.context);
newContext = mRenderer->getContext(); newContext = mRenderer->getContext();
......
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