Skip to content

Commit

Permalink
Add the ANGLEPlatform entry points to eglGetProcAddress
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
  • Loading branch information
Kangz authored and Commit Bot committed Nov 11, 2016
1 parent ea58654 commit 0504fcc
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/libGLESv2/entry_points_egl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "common/debug.h"
#include "common/version.h"

#include "platform/Platform.h"

#include <EGL/eglext.h>

namespace egl
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
};

Expand Down

0 comments on commit 0504fcc

Please sign in to comment.