EGL: Add the EGL_ANDROID_wait_sync extension

Change-Id: Ie9a78e07fcaf27c5c13797141ad3c692217607fb
This commit is contained in:
Jamie Gennis 2012-09-09 17:46:17 -07:00
parent 605f90dc86
commit 010dd4fb89
3 changed files with 27 additions and 0 deletions

View File

@ -284,6 +284,16 @@ EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR
typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROID) (EGLDisplay dpy, EGLSyncKHR sync);
#endif
/* EGL_ANDROID_wait_sync
*/
#ifndef EGL_ANDROID_wait_sync
#define EGL_ANDROID_wait_sync
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLint EGLAPIENTRY eglWaitSyncANDROID(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
#endif
typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCANDROID) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
#endif
#ifdef __cplusplus
}
#endif

View File

@ -653,6 +653,7 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
// internally by the Android EGL layer.
if (!strcmp(procname, "eglSetBlobCacheFuncsANDROID") ||
!strcmp(procname, "eglDupNativeFenceFDANDROID") ||
!strcmp(procname, "eglWaitSyncANDROID") ||
!strcmp(procname, "eglHibernateProcessIMG") ||
!strcmp(procname, "eglAwakenProcessIMG")) {
return NULL;
@ -1206,6 +1207,21 @@ EGLint eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR sync)
return result;
}
EGLint eglWaitSyncANDROID(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags)
{
clearError();
const egl_display_ptr dp = validate_display(dpy);
if (!dp) return EGL_NO_NATIVE_FENCE_FD_ANDROID;
EGLint result = EGL_FALSE;
egl_connection_t* const cnx = &gEGLImpl;
if (cnx->dso && cnx->egl.eglWaitSyncANDROID) {
result = cnx->egl.eglWaitSyncANDROID(dp->disp.dpy, sync, flags);
}
return result;
}
// ----------------------------------------------------------------------------
// NVIDIA extensions
// ----------------------------------------------------------------------------

View File

@ -63,6 +63,7 @@ EGL_ENTRY(EGLBoolean, eglGetSyncAttribKHR, EGLDisplay, EGLSyncKHR, EGLint,
EGL_ENTRY(EGLBoolean, eglSetSwapRectangleANDROID, EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint)
EGL_ENTRY(EGLClientBuffer, eglGetRenderBufferANDROID, EGLDisplay, EGLSurface)
EGL_ENTRY(EGLint, eglDupNativeFenceFDANDROID, EGLDisplay, EGLSyncKHR)
EGL_ENTRY(EGLint, eglWaitSyncANDROID, EGLDisplay, EGLSyncKHR, EGLint)
/* NVIDIA extensions */