src/libandroid/native_window.c: the part that should go in libEGL_bio: intercept eglGetProcAddress so we can stub extensions

This commit is contained in:
Mis012
2022-12-31 16:56:49 +01:00
parent eb9b2cb53e
commit 2a7345e44e
2 changed files with 11 additions and 0 deletions

View File

@@ -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))

View File

@@ -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