egl: Unbind the old context in _eglBindContext.
The last commit incorrectly moved the code under an "else".
This commit is contained in:
parent
bbe459b14d
commit
848945e5d6
|
@ -378,19 +378,18 @@ _eglBindContext(_EGLContext **ctx, _EGLSurface **draw, _EGLSurface **read)
|
|||
/* bind the new context */
|
||||
oldCtx = _eglBindContextToThread(newCtx, t);
|
||||
|
||||
if (newCtx) {
|
||||
if (newCtx)
|
||||
_eglBindContextToSurfaces(newCtx, draw, read);
|
||||
}
|
||||
else {
|
||||
assert(!*draw && !*read);
|
||||
if (oldCtx) {
|
||||
*draw = oldCtx->DrawSurface;
|
||||
*read = oldCtx->ReadSurface;
|
||||
assert(*draw && *read);
|
||||
|
||||
/* unbind the old context from its surfaces */
|
||||
_eglBindContextToSurfaces(NULL, draw, read);
|
||||
}
|
||||
/* unbind the old context from its binding surfaces */
|
||||
if (oldCtx && oldCtx != newCtx) {
|
||||
assert(!*draw && !*read);
|
||||
|
||||
*draw = oldCtx->DrawSurface;
|
||||
*read = oldCtx->ReadSurface;
|
||||
assert(*draw && *read);
|
||||
|
||||
_eglBindContextToSurfaces(NULL, draw, read);
|
||||
}
|
||||
|
||||
*ctx = oldCtx;
|
||||
|
|
Loading…
Reference in New Issue