Commit 0504fcc1 by Corentin Wallez Committed by Commit Bot

Add the ANGLEPlatform entry points to eglGetProcAddress

We want to move the Chromium initialization of the ANGLE platform from being Windows-specific to being EGL-specific. Because the mechanisms by which the ANGLE library is loaded are OS-specific, it is inconvenient to use dlsym and friends to get the ANGLEPlatform entry points. Instead we expose the through eglGetProcAddress which is readily available in the EGL-specific part of Chromium. BUG=angleproject:1621 Change-Id: I7adbea003103d0331ec9eece7b881e27bd6b1a5d Reviewed-on: https://chromium-review.googlesource.com/410063 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent ea586549
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include "common/debug.h" #include "common/debug.h"
#include "common/version.h" #include "common/version.h"
#include "platform/Platform.h"
#include <EGL/eglext.h> #include <EGL/eglext.h>
namespace egl namespace egl
...@@ -1275,6 +1277,9 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char * ...@@ -1275,6 +1277,9 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char *
#define INSERT_PROC_ADDRESS(ns, proc) \ #define INSERT_PROC_ADDRESS(ns, proc) \
map[#ns #proc] = reinterpret_cast<__eglMustCastToProperFunctionPointerType>(ns::proc) map[#ns #proc] = reinterpret_cast<__eglMustCastToProperFunctionPointerType>(ns::proc)
#define INSERT_PROC_ADDRESS_NO_NS(name, proc) \
map[name] = reinterpret_cast<__eglMustCastToProperFunctionPointerType>(proc)
// GLES2 core // GLES2 core
INSERT_PROC_ADDRESS(gl, ActiveTexture); INSERT_PROC_ADDRESS(gl, ActiveTexture);
INSERT_PROC_ADDRESS(gl, AttachShader); INSERT_PROC_ADDRESS(gl, AttachShader);
...@@ -1666,8 +1671,8 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char * ...@@ -1666,8 +1671,8 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char *
INSERT_PROC_ADDRESS(gl, UniformBlockBinding); INSERT_PROC_ADDRESS(gl, UniformBlockBinding);
INSERT_PROC_ADDRESS(gl, DrawArraysInstanced); INSERT_PROC_ADDRESS(gl, DrawArraysInstanced);
INSERT_PROC_ADDRESS(gl, DrawElementsInstanced); INSERT_PROC_ADDRESS(gl, DrawElementsInstanced);
map["glFenceSync"] = // FenceSync is the name of a class, the function has an added _ to prevent a name conflict.
reinterpret_cast<__eglMustCastToProperFunctionPointerType>(gl::FenceSync_); INSERT_PROC_ADDRESS_NO_NS("glFenceSync", gl::FenceSync_);
INSERT_PROC_ADDRESS(gl, IsSync); INSERT_PROC_ADDRESS(gl, IsSync);
INSERT_PROC_ADDRESS(gl, DeleteSync); INSERT_PROC_ADDRESS(gl, DeleteSync);
INSERT_PROC_ADDRESS(gl, ClientWaitSync); INSERT_PROC_ADDRESS(gl, ClientWaitSync);
...@@ -1870,7 +1875,13 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char * ...@@ -1870,7 +1875,13 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char *
// EGL_EXT_swap_buffers_with_damage // EGL_EXT_swap_buffers_with_damage
INSERT_PROC_ADDRESS(egl, SwapBuffersWithDamageEXT); INSERT_PROC_ADDRESS(egl, SwapBuffersWithDamageEXT);
// angle::Platform related entry points
INSERT_PROC_ADDRESS_NO_NS("ANGLEPlatformInitialize", ANGLEPlatformInitialize);
INSERT_PROC_ADDRESS_NO_NS("ANGLEPlatformShutdown", ANGLEPlatformShutdown);
#undef INSERT_PROC_ADDRESS #undef INSERT_PROC_ADDRESS
#undef INSERT_PROC_ADDRESS_NO_NS
return map; return map;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment