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:
@@ -416,7 +416,7 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list,
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_CONTEXT);
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -515,7 +515,7 @@ eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -536,7 +536,7 @@ eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_PIXMAP, EGL_NO_SURFACE);
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -555,7 +555,7 @@ eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
|
||||
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -1043,7 +1043,7 @@ eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config,
|
||||
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -1235,7 +1235,7 @@ eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype,
|
||||
|
||||
surf = drv->API.CreatePbufferFromClientBuffer(drv, disp, buftype, buffer,
|
||||
conf, attrib_list);
|
||||
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE;
|
||||
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
|
||||
|
||||
RETURN_EGL_EVAL(disp, ret);
|
||||
}
|
||||
@@ -1298,7 +1298,7 @@ eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
|
||||
|
||||
img = drv->API.CreateImageKHR(drv,
|
||||
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);
|
||||
}
|
||||
@@ -1344,7 +1344,7 @@ eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
|
||||
RETURN_EGL_EVAL(disp, EGL_NO_SYNC_KHR);
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -1463,7 +1463,7 @@ eglCreateDRMImageMESA(EGLDisplay dpy, const EGLint *attr_list)
|
||||
RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR);
|
||||
|
||||
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);
|
||||
}
|
||||
|
@@ -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.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
@@ -233,17 +233,16 @@ _eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy)
|
||||
|
||||
|
||||
/**
|
||||
* Link a resource to a display.
|
||||
* Link a resource to its display.
|
||||
*/
|
||||
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->Next = dpy->ResourceLists[type];
|
||||
dpy->ResourceLists[type] = res;
|
||||
res->Next = res->Display->ResourceLists[type];
|
||||
res->Display->ResourceLists[type] = res;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -162,7 +162,7 @@ _eglGetDisplayHandle(_EGLDisplay *dpy)
|
||||
|
||||
|
||||
extern void
|
||||
_eglLinkResource(_EGLResource *res, _EGLResourceType type, _EGLDisplay *dpy);
|
||||
_eglLinkResource(_EGLResource *res, _EGLResourceType type);
|
||||
|
||||
|
||||
extern void
|
||||
|
@@ -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.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
@@ -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.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
@@ -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.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user