diff options
Diffstat (limited to 'src/egl/main/eglapi.c')
-rw-r--r-- | src/egl/main/eglapi.c | 70 |
1 files changed, 42 insertions, 28 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index c339e6ebeb..90f622690c 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -57,7 +57,6 @@ #include <stdlib.h> #include <string.h> -#include "eglstring.h" #include "eglcontext.h" #include "egldisplay.h" #include "egltypedefs.h" @@ -294,16 +293,14 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) if (!_eglMatchDriver(disp, EGL_FALSE)) RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE); - _eglsnprintf(disp->Version, sizeof(disp->Version), "%d.%d (%s)", - disp->APImajor, disp->APIminor, disp->Driver->Name); /* limit to APIs supported by core */ - disp->ClientAPIsMask &= _EGL_API_ALL_BITS; + disp->ClientAPIs &= _EGL_API_ALL_BITS; } /* Update applications version of major and minor if not NULL */ if ((major != NULL) && (minor != NULL)) { - *major = disp->APImajor; - *minor = disp->APIminor; + *major = disp->VersionMajor; + *minor = disp->VersionMinor; } RETURN_EGL_SUCCESS(disp, EGL_TRUE); @@ -917,12 +914,13 @@ eglGetProcAddress(const char *procname) { "eglCreateDRMImageMESA", (_EGLProc) eglCreateDRMImageMESA }, { "eglExportDRMImageMESA", (_EGLProc) eglExportDRMImageMESA }, #endif +#ifdef EGL_WL_bind_display + { "eglBindWaylandDisplayWL", (_EGLProc) eglBindWaylandDisplayWL }, + { "eglUnbindWaylandDisplayWL", (_EGLProc) eglUnbindWaylandDisplayWL }, +#endif #ifdef EGL_ANDROID_swap_rectangle { "eglSetSwapRectangleANDROID", (_EGLProc) eglSetSwapRectangleANDROID }, #endif -#ifdef EGL_ANDROID_get_render_buffer - { "eglGetRenderBufferANDROID", (_EGLProc) eglGetRenderBufferANDROID }, -#endif { NULL, NULL } }; EGLint i; @@ -1501,48 +1499,64 @@ eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image, #endif -#ifdef EGL_ANDROID_swap_rectangle +#ifdef EGL_WL_bind_wayland_display +struct wl_display; EGLBoolean EGLAPIENTRY -eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, - EGLint left, EGLint top, - EGLint width, EGLint height) +eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display) { _EGLDisplay *disp = _eglLockDisplay(dpy); - _EGLSurface *surf = _eglLookupSurface(draw, disp); _EGLDriver *drv; EGLBoolean ret; - _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); + _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv); + assert(disp->Extensions.WL_bind_wayland_display); - if (!disp->Extensions.ANDROID_swap_rectangle) - RETURN_EGL_EVAL(disp, EGL_FALSE); + if (!display) + RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); - ret = drv->API.SetSwapRectangleANDROID(drv, disp, surf, left, top, width, height); + ret = drv->API.BindWaylandDisplayWL(drv, disp, display); RETURN_EGL_EVAL(disp, ret); } -#endif +EGLBoolean EGLAPIENTRY +eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display) +{ + _EGLDisplay *disp = _eglLockDisplay(dpy); + _EGLDriver *drv; + EGLBoolean ret; -#ifdef EGL_ANDROID_get_render_buffer + _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv); + assert(disp->Extensions.WL_bind_wayland_display); + + if (!display) + RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); + + ret = drv->API.UnbindWaylandDisplayWL(drv, disp, display); + + RETURN_EGL_EVAL(disp, ret); +} +#endif -EGLClientBuffer EGLAPIENTRY -eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw) +#ifdef EGL_ANDROID_swap_rectangle +EGLBoolean EGLAPIENTRY +eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, + EGLint left, EGLint top, + EGLint width, EGLint height) { _EGLDisplay *disp = _eglLockDisplay(dpy); _EGLSurface *surf = _eglLookupSurface(draw, disp); _EGLDriver *drv; - EGLClientBuffer ret; + EGLBoolean ret; - _EGL_CHECK_SURFACE(disp, surf, NULL, drv); + _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); - if (!disp->Extensions.ANDROID_get_render_buffer) - RETURN_EGL_EVAL(disp, NULL); + if (!disp->Extensions.ANDROID_swap_rectangle) + RETURN_EGL_EVAL(disp, EGL_FALSE); - ret = drv->API.GetRenderBufferANDROID(drv, disp, surf); + ret = drv->API.SetSwapRectangleANDROID(drv, disp, surf, left, top, width, height); RETURN_EGL_EVAL(disp, ret); } - #endif |