зеркало из https://github.com/AvaloniaUI/angle.git
Add the ANGLEPlatform entry points to eglGetProcAddress
Reland with a Windows build fix. 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: I022a39493756a3b5d1ed626fd05e74af3f043211 Reviewed-on: https://chromium-review.googlesource.com/410066 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
This commit is contained in:
Родитель
c51642b40f
Коммит
64598b53ef
3
BUILD.gn
3
BUILD.gn
|
@ -277,6 +277,7 @@ config("libANGLE_config") {
|
|||
defines += [
|
||||
"GL_GLEXT_PROTOTYPES",
|
||||
"EGL_EGLEXT_PROTOTYPES",
|
||||
"LIBANGLE_IMPLEMENTATION",
|
||||
]
|
||||
|
||||
if (is_win) {
|
||||
|
@ -300,7 +301,7 @@ static_library("libANGLE") {
|
|||
|
||||
include_dirs = []
|
||||
libs = []
|
||||
defines = [ "LIBANGLE_IMPLEMENTATION" ]
|
||||
defines = []
|
||||
public_deps = [
|
||||
":angle_common",
|
||||
]
|
||||
|
|
|
@ -741,6 +741,7 @@
|
|||
],
|
||||
'defines':
|
||||
[
|
||||
'LIBANGLE_IMPLEMENTATION',
|
||||
'GL_GLEXT_PROTOTYPES',
|
||||
'ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ "d3dcompiler_47.dll", "d3dcompiler_46.dll", "d3dcompiler_43.dll" }',
|
||||
],
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
#include "common/debug.h"
|
||||
#include "common/version.h"
|
||||
|
||||
#include "platform/Platform.h"
|
||||
|
||||
#include <EGL/eglext.h>
|
||||
|
||||
namespace egl
|
||||
|
@ -1275,6 +1277,9 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char *
|
|||
#define INSERT_PROC_ADDRESS(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
|
||||
INSERT_PROC_ADDRESS(gl, ActiveTexture);
|
||||
INSERT_PROC_ADDRESS(gl, AttachShader);
|
||||
|
@ -1666,8 +1671,8 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char *
|
|||
INSERT_PROC_ADDRESS(gl, UniformBlockBinding);
|
||||
INSERT_PROC_ADDRESS(gl, DrawArraysInstanced);
|
||||
INSERT_PROC_ADDRESS(gl, DrawElementsInstanced);
|
||||
map["glFenceSync"] =
|
||||
reinterpret_cast<__eglMustCastToProperFunctionPointerType>(gl::FenceSync_);
|
||||
// FenceSync is the name of a class, the function has an added _ to prevent a name conflict.
|
||||
INSERT_PROC_ADDRESS_NO_NS("glFenceSync", gl::FenceSync_);
|
||||
INSERT_PROC_ADDRESS(gl, IsSync);
|
||||
INSERT_PROC_ADDRESS(gl, DeleteSync);
|
||||
INSERT_PROC_ADDRESS(gl, ClientWaitSync);
|
||||
|
@ -1870,7 +1875,13 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char *
|
|||
// EGL_EXT_swap_buffers_with_damage
|
||||
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_NO_NS
|
||||
|
||||
return map;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче