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

Commit 2600c7b3 authored by Yiwei Zhang's avatar Yiwei Zhang Committed by Android (Google) Code Review
Browse files

Merge "Make a GLESv1 only entries for GLESv1 driver loading"

parents bf37245a 7cc58921
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -274,6 +274,7 @@ void Loader::close(void* driver)

void Loader::init_api(void* dso,
        char const * const * api,
        char const * const * ref_api,
        __eglMustCastToProperFunctionPointerType* curr,
        getProcAddressType getProcAddress)
{
@@ -283,6 +284,15 @@ void Loader::init_api(void* dso,
    char scrap[SIZE];
    while (*api) {
        char const * name = *api;
        if (ref_api) {
            char const * ref_name = *ref_api;
            if (std::strcmp(name, ref_name) != 0) {
                *curr++ = nullptr;
                ref_api++;
                continue;
            }
        }

        __eglMustCastToProperFunctionPointerType f =
            (__eglMustCastToProperFunctionPointerType)dlsym(dso, name);
        if (f == nullptr) {
@@ -327,6 +337,7 @@ void Loader::init_api(void* dso,
        }
        *curr++ = f;
        api++;
        if (ref_api) ref_api++;
    }
}

@@ -670,14 +681,14 @@ void *Loader::load_driver(const char* kind,
    }

    if (mask & GLESv1_CM) {
        init_api(dso, gl_names,
        init_api(dso, gl_names_1, gl_names,
            (__eglMustCastToProperFunctionPointerType*)
                &cnx->hooks[egl_connection_t::GLESv1_INDEX]->gl,
            getProcAddress);
    }

    if (mask & GLESv2) {
      init_api(dso, gl_names,
        init_api(dso, gl_names, nullptr,
            (__eglMustCastToProperFunctionPointerType*)
                &cnx->hooks[egl_connection_t::GLESv2_INDEX]->gl,
            getProcAddress);
+9 −8
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ private:
    static __attribute__((noinline))
    void init_api(void* dso,
            char const * const * api,
            char const * const * ref_api,
            __eglMustCastToProperFunctionPointerType* curr,
            getProcAddressType getProcAddress);
};
+5 −0
Original line number Diff line number Diff line
@@ -263,6 +263,11 @@ char const * const gl_names[] = {
    nullptr
};

char const * const gl_names_1[] = {
    #include "../entries_gles1.in"
    nullptr
};

char const * const egl_names[] = {
    #include "egl_entries.in"
    nullptr
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ extern "C" void gl_unimplemented();
extern "C" void gl_noop();

extern char const * const gl_names[];
extern char const * const gl_names_1[];
extern char const * const egl_names[];
extern char const * const platform_names[];

+298 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading