summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/egl/drivers/xdri/egl_xdri.c2
-rw-r--r--src/egl/main/eglcontext.c16
-rw-r--r--src/egl/main/eglsurface.h14
-rw-r--r--src/gallium/state_trackers/egl/common/egl_g3d.c4
4 files changed, 18 insertions, 18 deletions
diff --git a/src/egl/drivers/xdri/egl_xdri.c b/src/egl/drivers/xdri/egl_xdri.c
index 10f7a31f5b..9c21576539 100644
--- a/src/egl/drivers/xdri/egl_xdri.c
+++ b/src/egl/drivers/xdri/egl_xdri.c
@@ -600,7 +600,7 @@ xdri_eglSwapBuffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *draw)
struct xdri_egl_surface *xdri_surf = lookup_surface(draw);
/* swapBuffers does not flush commands */
- if (draw->Binding && xdri_driver->FlushCurrentContext)
+ if (draw->CurrentContext && xdri_driver->FlushCurrentContext)
xdri_driver->FlushCurrentContext();
xdri_dpy->psc->driScreen->swapBuffers(xdri_surf->driDrawable, 0, 0, 0);
diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
index ee9d60e17a..37c4b25b68 100644
--- a/src/egl/main/eglcontext.c
+++ b/src/egl/main/eglcontext.c
@@ -150,13 +150,13 @@ _eglBindContextToSurfaces(_EGLContext *ctx,
{
_EGLSurface *newDraw = *draw, *newRead = *read;
- if (newDraw->Binding)
- newDraw->Binding->DrawSurface = NULL;
- newDraw->Binding = ctx;
+ if (newDraw->CurrentContext)
+ newDraw->CurrentContext->DrawSurface = NULL;
+ newDraw->CurrentContext = ctx;
- if (newRead->Binding)
- newRead->Binding->ReadSurface = NULL;
- newRead->Binding = ctx;
+ if (newRead->CurrentContext)
+ newRead->CurrentContext->ReadSurface = NULL;
+ newRead->CurrentContext = ctx;
if (ctx) {
*draw = ctx->DrawSurface;
@@ -238,8 +238,8 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
*
* The latter is more restrictive so we can check only the latter case.
*/
- if ((draw->Binding && draw->Binding != ctx) ||
- (read->Binding && read->Binding != ctx))
+ if ((draw->CurrentContext && draw->CurrentContext != ctx) ||
+ (read->CurrentContext && read->CurrentContext != ctx))
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
/* simply require the configs to be equal */
diff --git a/src/egl/main/eglsurface.h b/src/egl/main/eglsurface.h
index 4062b990fa..eee66f6d86 100644
--- a/src/egl/main/eglsurface.h
+++ b/src/egl/main/eglsurface.h
@@ -14,9 +14,8 @@ struct _egl_surface
/* A surface is a display resource */
_EGLResource Resource;
- /* The bound status of the surface */
- _EGLContext *Binding;
- EGLBoolean BoundToTexture;
+ /* The context that is currently bound to the surface */
+ _EGLContext *CurrentContext;
_EGLConfig *Config;
@@ -26,6 +25,9 @@ struct _egl_surface
EGLint MipmapTexture, MipmapLevel;
EGLint SwapInterval;
+ /* True if the surface is bound to an OpenGL ES texture */
+ EGLBoolean BoundToTexture;
+
/* If type == EGL_SCREEN_BIT: */
EGLint VisibleRefCount; /* number of screens I'm displayed on */
@@ -100,14 +102,12 @@ _eglCreatePbufferFromClientBuffer(_EGLDriver *drv, _EGLDisplay *dpy,
/**
- * Return true if the surface is bound to a thread.
- * A surface bound to a texutre is not considered bound by
- * this function.
+ * Return true if there is a context bound to the surface.
*/
static INLINE EGLBoolean
_eglIsSurfaceBound(_EGLSurface *surf)
{
- return (surf->Binding != NULL);
+ return (surf->CurrentContext != NULL);
}
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c
index f8334217c4..3f520851c4 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d.c
@@ -1129,8 +1129,8 @@ egl_g3d_bind_tex_image(_EGLDriver *drv, _EGLDisplay *dpy,
}
/* flush properly if the surface is bound */
- if (gsurf->base.Binding) {
- gctx = egl_g3d_context(gsurf->base.Binding);
+ if (gsurf->base.CurrentContext) {
+ gctx = egl_g3d_context(gsurf->base.CurrentContext);
gctx->stapi->st_flush(gctx->st_ctx,
PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, NULL);
}