Commit d11efaec by Geoff Lang Committed by Commit Bot

Release the current context's surface before making the next context current.

We were calling context->releaseSurface on a context that was no longer current, this somtimes caused incorrect framebuffers to be deleted. BUG=angleproject:2464 Change-Id: I6859b5739a509c1343901f8c0eef1fdd1598cea1 Reviewed-on: https://chromium-review.googlesource.com/1108087Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent fddac3a3
......@@ -513,11 +513,6 @@ EGLBoolean EGLAPIENTRY MakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface r
// Only call makeCurrent if the context or surfaces have changed.
if (previousDraw != drawSurface || previousRead != readSurface || previousContext != context)
{
ANGLE_EGL_TRY_RETURN(thread, display->makeCurrent(drawSurface, readSurface, context),
"eglMakeCurrent", GetContextIfValid(display, context), EGL_FALSE);
thread->setCurrent(context);
// Release the surface from the previously-current context, to allow
// destroyed surfaces to delete themselves.
if (previousContext != nullptr && context != previousContext)
......@@ -525,6 +520,11 @@ EGLBoolean EGLAPIENTRY MakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface r
ANGLE_EGL_TRY_RETURN(thread, previousContext->releaseSurface(display), "eglMakeCurrent",
GetContextIfValid(display, context), EGL_FALSE);
}
ANGLE_EGL_TRY_RETURN(thread, display->makeCurrent(drawSurface, readSurface, context),
"eglMakeCurrent", GetContextIfValid(display, context), EGL_FALSE);
thread->setCurrent(context);
}
thread->setSuccess();
......
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