You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
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:
@@ -5,6 +5,9 @@
|
|||||||
|
|
||||||
#define DEG2RAD(deg) (deg * M_PI / 180)
|
#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
|
// 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))
|
#define _PTR(ptr)((void*)(intptr_t)(ptr))
|
||||||
|
|||||||
@@ -375,6 +375,14 @@ EGLBoolean bionic_eglPresentationTimeANDROID(EGLDisplay dpy, EGLSurface surface,
|
|||||||
return EGL_TRUE;
|
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)
|
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
|
// XXX - we can't use pbuffers with wayland EGLDisplay, for now one has to use an env to bypass
|
||||||
|
|||||||
Reference in New Issue
Block a user