egl: Drop dpy argument from the link functions.

All display resources are already initialized with a display.  Linking
simply links a resource to its display.
This commit is contained in:
Chia-I Wu
2010-10-23 00:37:19 +08:00
parent 07cd8f46ac
commit 4ce33ec606
7 changed files with 27 additions and 28 deletions

View File

@@ -416,7 +416,7 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list,
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_CONTEXT); RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_CONTEXT);
context = drv->API.CreateContext(drv, disp, conf, share, attrib_list); context = drv->API.CreateContext(drv, disp, conf, share, attrib_list);
ret = (context) ? _eglLinkContext(context, disp) : EGL_NO_CONTEXT; ret = (context) ? _eglLinkContext(context) : EGL_NO_CONTEXT;
RETURN_EGL_EVAL(disp, ret); RETURN_EGL_EVAL(disp, ret);
} }
@@ -515,7 +515,7 @@ eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE); RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
surf = drv->API.CreateWindowSurface(drv, disp, conf, window, attrib_list); surf = drv->API.CreateWindowSurface(drv, disp, conf, window, attrib_list);
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE; ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret); RETURN_EGL_EVAL(disp, ret);
} }
@@ -536,7 +536,7 @@ eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_PIXMAP, EGL_NO_SURFACE); RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_PIXMAP, EGL_NO_SURFACE);
surf = drv->API.CreatePixmapSurface(drv, disp, conf, pixmap, attrib_list); surf = drv->API.CreatePixmapSurface(drv, disp, conf, pixmap, attrib_list);
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE; ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret); RETURN_EGL_EVAL(disp, ret);
} }
@@ -555,7 +555,7 @@ eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv); _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
surf = drv->API.CreatePbufferSurface(drv, disp, conf, attrib_list); surf = drv->API.CreatePbufferSurface(drv, disp, conf, attrib_list);
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE; ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret); RETURN_EGL_EVAL(disp, ret);
} }
@@ -1043,7 +1043,7 @@ eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config,
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv); _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
surf = drv->API.CreateScreenSurfaceMESA(drv, disp, conf, attrib_list); surf = drv->API.CreateScreenSurfaceMESA(drv, disp, conf, attrib_list);
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE; ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret); RETURN_EGL_EVAL(disp, ret);
} }
@@ -1235,7 +1235,7 @@ eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype,
surf = drv->API.CreatePbufferFromClientBuffer(drv, disp, buftype, buffer, surf = drv->API.CreatePbufferFromClientBuffer(drv, disp, buftype, buffer,
conf, attrib_list); conf, attrib_list);
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE; ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret); RETURN_EGL_EVAL(disp, ret);
} }
@@ -1298,7 +1298,7 @@ eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
img = drv->API.CreateImageKHR(drv, img = drv->API.CreateImageKHR(drv,
disp, context, target, buffer, attr_list); disp, context, target, buffer, attr_list);
ret = (img) ? _eglLinkImage(img, disp) : EGL_NO_IMAGE_KHR; ret = (img) ? _eglLinkImage(img) : EGL_NO_IMAGE_KHR;
RETURN_EGL_EVAL(disp, ret); RETURN_EGL_EVAL(disp, ret);
} }
@@ -1344,7 +1344,7 @@ eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
RETURN_EGL_EVAL(disp, EGL_NO_SYNC_KHR); RETURN_EGL_EVAL(disp, EGL_NO_SYNC_KHR);
sync = drv->API.CreateSyncKHR(drv, disp, type, attrib_list); sync = drv->API.CreateSyncKHR(drv, disp, type, attrib_list);
ret = (sync) ? _eglLinkSync(sync, disp) : EGL_NO_SYNC_KHR; ret = (sync) ? _eglLinkSync(sync) : EGL_NO_SYNC_KHR;
RETURN_EGL_EVAL(disp, ret); RETURN_EGL_EVAL(disp, ret);
} }
@@ -1463,7 +1463,7 @@ eglCreateDRMImageMESA(EGLDisplay dpy, const EGLint *attr_list)
RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR); RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR);
img = drv->API.CreateDRMImageMESA(drv, disp, attr_list); img = drv->API.CreateDRMImageMESA(drv, disp, attr_list);
ret = (img) ? _eglLinkImage(img, disp) : EGL_NO_IMAGE_KHR; ret = (img) ? _eglLinkImage(img) : EGL_NO_IMAGE_KHR;
RETURN_EGL_EVAL(disp, ret); RETURN_EGL_EVAL(disp, ret);
} }

View File

@@ -56,13 +56,13 @@ _eglIsContextBound(_EGLContext *ctx)
/** /**
* Link a context to a display and return the handle of the link. * Link a context to its display and return the handle of the link.
* The handle can be passed to client directly. * The handle can be passed to client directly.
*/ */
static INLINE EGLContext static INLINE EGLContext
_eglLinkContext(_EGLContext *ctx, _EGLDisplay *dpy) _eglLinkContext(_EGLContext *ctx)
{ {
_eglLinkResource(&ctx->Resource, _EGL_RESOURCE_CONTEXT, dpy); _eglLinkResource(&ctx->Resource, _EGL_RESOURCE_CONTEXT);
return (EGLContext) ctx; return (EGLContext) ctx;
} }

View File

@@ -233,17 +233,16 @@ _eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy)
/** /**
* Link a resource to a display. * Link a resource to its display.
*/ */
void void
_eglLinkResource(_EGLResource *res, _EGLResourceType type, _EGLDisplay *dpy) _eglLinkResource(_EGLResource *res, _EGLResourceType type)
{ {
assert(!res->Display || res->Display == dpy); assert(res->Display);
res->Display = dpy;
res->IsLinked = EGL_TRUE; res->IsLinked = EGL_TRUE;
res->Next = dpy->ResourceLists[type]; res->Next = res->Display->ResourceLists[type];
dpy->ResourceLists[type] = res; res->Display->ResourceLists[type] = res;
} }

View File

@@ -162,7 +162,7 @@ _eglGetDisplayHandle(_EGLDisplay *dpy)
extern void extern void
_eglLinkResource(_EGLResource *res, _EGLResourceType type, _EGLDisplay *dpy); _eglLinkResource(_EGLResource *res, _EGLResourceType type);
extern void extern void

View File

@@ -43,13 +43,13 @@ _eglInitImage(_EGLImage *img, _EGLDisplay *dpy);
/** /**
* Link an image to a display and return the handle of the link. * Link an image to its display and return the handle of the link.
* The handle can be passed to client directly. * The handle can be passed to client directly.
*/ */
static INLINE EGLImageKHR static INLINE EGLImageKHR
_eglLinkImage(_EGLImage *img, _EGLDisplay *dpy) _eglLinkImage(_EGLImage *img)
{ {
_eglLinkResource(&img->Resource, _EGL_RESOURCE_IMAGE, dpy); _eglLinkResource(&img->Resource, _EGL_RESOURCE_IMAGE);
return (EGLImageKHR) img; return (EGLImageKHR) img;
} }

View File

@@ -81,13 +81,13 @@ _eglIsSurfaceBound(_EGLSurface *surf)
/** /**
* Link a surface to a display and return the handle of the link. * Link a surface to its display and return the handle of the link.
* The handle can be passed to client directly. * The handle can be passed to client directly.
*/ */
static INLINE EGLSurface static INLINE EGLSurface
_eglLinkSurface(_EGLSurface *surf, _EGLDisplay *dpy) _eglLinkSurface(_EGLSurface *surf)
{ {
_eglLinkResource(&surf->Resource, _EGL_RESOURCE_SURFACE, dpy); _eglLinkResource(&surf->Resource, _EGL_RESOURCE_SURFACE);
return (EGLSurface) surf; return (EGLSurface) surf;
} }

View File

@@ -34,13 +34,13 @@ _eglGetSyncAttribKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
/** /**
* Link a sync to a display and return the handle of the link. * Link a sync to its display and return the handle of the link.
* The handle can be passed to client directly. * The handle can be passed to client directly.
*/ */
static INLINE EGLSyncKHR static INLINE EGLSyncKHR
_eglLinkSync(_EGLSync *sync, _EGLDisplay *dpy) _eglLinkSync(_EGLSync *sync)
{ {
_eglLinkResource(&sync->Resource, _EGL_RESOURCE_SYNC, dpy); _eglLinkResource(&sync->Resource, _EGL_RESOURCE_SYNC);
return (EGLSyncKHR) sync; return (EGLSyncKHR) sync;
} }