summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-04-06 11:51:25 +0800
committerChia-I Wu <olv@lunarg.com>2010-04-06 11:55:40 +0800
commit848945e5d63ff8327f5a1a6e61e66fcdab3ac8fc (patch)
tree5510147b35f3afe0286761bd5c70942504fd1fc9 /src
parentbbe459b14d593bd2d7b6c0f010e165fe815e8396 (diff)
egl: Unbind the old context in _eglBindContext.
The last commit incorrectly moved the code under an "else".
Diffstat (limited to 'src')
-rw-r--r--src/egl/main/eglcontext.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
index 80e316a10b..d5a1e79a99 100644
--- a/src/egl/main/eglcontext.c
+++ b/src/egl/main/eglcontext.c
@@ -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 {
+
+ /* unbind the old context from its binding surfaces */
+ if (oldCtx && oldCtx != newCtx) {
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);
- }
+ *draw = oldCtx->DrawSurface;
+ *read = oldCtx->ReadSurface;
+ assert(*draw && *read);
+
+ _eglBindContextToSurfaces(NULL, draw, read);
}
*ctx = oldCtx;