Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1034cfc7 authored by Jesse Hall's avatar Jesse Hall Committed by Android Git Automerger
Browse files

am 43b3e600: am 3f0d5669: Merge "Expose core EGL entry points to eglGetProcAddress"

* commit '43b3e600':
  Expose core EGL entry points to eglGetProcAddress
parents fb39827e 43b3e600
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -188,12 +188,17 @@ void* Loader::open(egl_connection_t* cnx)
    LOG_ALWAYS_FATAL_IF(!hnd, "couldn't find an OpenGL ES implementation");

#if defined(__LP64__)
    cnx->libEgl   = load_wrapper("/system/lib64/libEGL.so");
    cnx->libGles2 = load_wrapper("/system/lib64/libGLESv2.so");
    cnx->libGles1 = load_wrapper("/system/lib64/libGLESv1_CM.so");
#else
    cnx->libEgl   = load_wrapper("/system/lib/libEGL.so");
    cnx->libGles2 = load_wrapper("/system/lib/libGLESv2.so");
    cnx->libGles1 = load_wrapper("/system/lib/libGLESv1_CM.so");
#endif
    LOG_ALWAYS_FATAL_IF(!cnx->libEgl,
            "couldn't load system EGL wrapper libraries");

    LOG_ALWAYS_FATAL_IF(!cnx->libGles2 || !cnx->libGles1,
            "couldn't load system OpenGL ES wrapper libraries");

+5 −2
Original line number Diff line number Diff line
@@ -879,11 +879,14 @@ EGLint eglGetError(void)
    return err;
}

static __eglMustCastToProperFunctionPointerType findBuiltinGLWrapper(
static __eglMustCastToProperFunctionPointerType findBuiltinWrapper(
        const char* procname) {
    const egl_connection_t* cnx = &gEGLImpl;
    void* proc = NULL;

    proc = dlsym(cnx->libEgl, procname);
    if (proc) return (__eglMustCastToProperFunctionPointerType)proc;

    proc = dlsym(cnx->libGles2, procname);
    if (proc) return (__eglMustCastToProperFunctionPointerType)proc;

@@ -914,7 +917,7 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
    addr = findProcAddress(procname, sExtensionMap, NELEM(sExtensionMap));
    if (addr) return addr;

    addr = findBuiltinGLWrapper(procname);
    addr = findBuiltinWrapper(procname);
    if (addr) return addr;

    // this protects accesses to sGLExtentionMap and sGLExtentionSlot
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ struct egl_connection_t {
    EGLint              minor;
    egl_t               egl;

    void*               libEgl;
    void*               libGles1;
    void*               libGles2;
};