egl_dri2: Fix a typo that make glFlush be called at wrong time.
authorChia-I Wu <olv@lunarg.com>
Tue, 26 Oct 2010 07:00:56 +0000 (15:00 +0800)
committerChia-I Wu <olv@lunarg.com>
Tue, 26 Oct 2010 07:04:28 +0000 (15:04 +0800)
We want to call glFlush when there is a current context.  That is,
old_ctx.  This is a regression introduced by
d19afc57fe49816f3f3290410e0124d326577be2.

src/egl/drivers/dri2/egl_dri2.c

index a5f95b944c55039b7a2aeeea82339f1ef58dc82c..51834d74e3d3f80817c6db8bbadec04373e7419c 100644 (file)
@@ -1197,7 +1197,7 @@ dri2_make_current(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
       return EGL_FALSE;
 
    /* flush before context switch */
-   if (ctx && dri2_drv->glFlush)
+   if (old_ctx && dri2_drv->glFlush)
       dri2_drv->glFlush();
 
    ddraw = (dri2_dsurf) ? dri2_dsurf->dri_drawable : NULL;