Move platform entries init earlier
Test: cts-tradefed run singleCommand cts -m CtsGpuToolsHostTestCases
Test: Chromium starts up
Test: deqp - EGL, GLES2, GLES3
Bug: 110883880
Change-Id: I07bdb9552c6cd568eef0aa0499bf8a027e404d34
diff --git a/opengl/libs/EGL/egldefs.h b/opengl/libs/EGL/egldefs.h
index d8606d3..77654b0 100644
--- a/opengl/libs/EGL/egldefs.h
+++ b/opengl/libs/EGL/egldefs.h
@@ -18,6 +18,9 @@
#define ANDROID_EGLDEFS_H
#include "../hooks.h"
+#include "egl_platform_entries.h"
+
+#include <log/log.h>
#define VERSION_MAJOR 1
#define VERSION_MINOR 4
@@ -31,13 +34,31 @@
// ----------------------------------------------------------------------------
+extern char const * const platform_names[];
+
struct egl_connection_t {
enum {
GLESv1_INDEX = 0,
GLESv2_INDEX = 1
};
- inline egl_connection_t() : dso(nullptr) { }
+ inline egl_connection_t() : dso(nullptr) {
+
+ char const* const* entries = platform_names;
+ EGLFuncPointer* curr = reinterpret_cast<EGLFuncPointer*>(&platform);
+ while (*entries) {
+ const char* name = *entries;
+ EGLFuncPointer f = FindPlatformImplAddr(name);
+
+ if (f == nullptr) {
+ // If no entry found, update the lookup table: sPlatformImplMap
+ ALOGE("No entry found in platform lookup table for %s", name);
+ }
+
+ *curr++ = f;
+ entries++;
+ }
+ }
void * dso;
gl_hooks_t * hooks[2];
@@ -68,7 +89,6 @@
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[];
extern egl_connection_t gEGLImpl;