diff --git a/src/api-impl-jni/defines.h b/src/api-impl-jni/defines.h index 6ee2b490..887e4b0e 100644 --- a/src/api-impl-jni/defines.h +++ b/src/api-impl-jni/defines.h @@ -5,6 +5,9 @@ #define DEG2RAD(deg) (deg * M_PI / 180) +#define __likely__(x) __builtin_expect(x, 1) +#define __unlikely__(x) __builtin_expect(x, 0) + // these macros are a bit hacky, since they deliberately assume that env exists and refers to the JNI env #define _PTR(ptr)((void*)(intptr_t)(ptr)) diff --git a/src/libandroid/native_window.c b/src/libandroid/native_window.c index c09548f7..3d3a6093 100644 --- a/src/libandroid/native_window.c +++ b/src/libandroid/native_window.c @@ -375,6 +375,14 @@ EGLBoolean bionic_eglPresentationTimeANDROID(EGLDisplay dpy, EGLSurface surface, return EGL_TRUE; } +void (* bionic_eglGetProcAddress(char const *procname))(void) +{ + if(__unlikely__(!strcmp(procname, "eglPresentationTimeANDROID"))) + return bionic_eglPresentationTimeANDROID; + + return eglGetProcAddress(procname); +} + EGLDisplay bionic_eglGetDisplay(NativeDisplayType native_display) { // XXX - we can't use pbuffers with wayland EGLDisplay, for now one has to use an env to bypass