Bug 1620075. Use GetPlatformDisplay instead of GetPlatformDisplayEXT. r=jgilbert

GetPlatformDisplay takes a list of EGLAttrib instead of EGLInt. This is needed
if we want to pass EGL_FEATURE_OVERRIDES_ENABLED_ANGLE.

Differential Revision: https://phabricator.services.mozilla.com/D96451
This commit is contained in:
Jeff Muizelaar 2020-11-10 02:23:09 +00:00
parent 4e04804ac7
commit 030b73a0a5
2 changed files with 17 additions and 17 deletions

View File

@ -146,13 +146,13 @@ static std::shared_ptr<EglDisplay> GetAndInitDisplay(GLLibraryEGL& egl,
static std::shared_ptr<EglDisplay> GetAndInitWARPDisplay(GLLibraryEGL& egl,
void* displayType) {
const EGLint attrib_list[] = {LOCAL_EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE,
LOCAL_EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE,
// Requires:
LOCAL_EGL_PLATFORM_ANGLE_TYPE_ANGLE,
LOCAL_EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
LOCAL_EGL_NONE};
const EGLDisplay display = egl.fGetPlatformDisplayEXT(
const EGLAttrib attrib_list[] = {LOCAL_EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE,
LOCAL_EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE,
// Requires:
LOCAL_EGL_PLATFORM_ANGLE_TYPE_ANGLE,
LOCAL_EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
LOCAL_EGL_NONE};
const EGLDisplay display = egl.fGetPlatformDisplay(
LOCAL_EGL_PLATFORM_ANGLE_ANGLE, displayType, attrib_list);
if (display == EGL_NO_DISPLAY) {
@ -176,9 +176,9 @@ std::shared_ptr<EglDisplay> GLLibraryEGL::CreateDisplay(
return nullptr;
}
// Create an EGLDisplay using the EGLDevice
const EGLint attrib_list[] = {LOCAL_EGL_NONE};
const auto display = fGetPlatformDisplayEXT(LOCAL_EGL_PLATFORM_DEVICE_EXT,
eglDevice, attrib_list);
const EGLAttrib attrib_list[] = {LOCAL_EGL_NONE};
const auto display = fGetPlatformDisplay(LOCAL_EGL_PLATFORM_DEVICE_EXT,
eglDevice, attrib_list);
if (!display) {
gfxCriticalNote << "Failed to get EGLDisplay of D3D11Device";
return nullptr;
@ -493,7 +493,7 @@ bool GLLibraryEGL::Init(nsACString* const out_failureId) {
if (mIsANGLE) {
MOZ_ASSERT(IsExtensionSupported(EGLLibExtension::ANGLE_platform_angle_d3d));
const SymLoadStruct angleSymbols[] = {SYMBOL(GetPlatformDisplayEXT),
const SymLoadStruct angleSymbols[] = {SYMBOL(GetPlatformDisplay),
END_OF_SYMBOLS};
if (!fnLoadSymbols(angleSymbols)) {
gfxCriticalError() << "Failed to load ANGLE symbols!";

View File

@ -187,9 +187,9 @@ class GLLibraryEGL final {
WRAP(fGetDisplay(display_id));
}
EGLDisplay fGetPlatformDisplayEXT(EGLenum platform, void* native_display,
const EGLint* attrib_list) const {
WRAP(fGetPlatformDisplayEXT(platform, native_display, attrib_list));
EGLDisplay fGetPlatformDisplay(EGLenum platform, void* native_display,
const EGLAttrib* attrib_list) const {
WRAP(fGetPlatformDisplay(platform, native_display, attrib_list));
}
EGLSurface fGetCurrentSurface(EGLint id) const {
@ -460,9 +460,9 @@ class GLLibraryEGL final {
struct {
EGLCastToRelevantPtr(GLAPIENTRY* fGetProcAddress)(const char* procname);
EGLDisplay(GLAPIENTRY* fGetDisplay)(void* display_id);
EGLDisplay(GLAPIENTRY* fGetPlatformDisplayEXT)(EGLenum platform,
void* native_display,
const EGLint* attrib_list);
EGLDisplay(GLAPIENTRY* fGetPlatformDisplay)(EGLenum platform,
void* native_display,
const EGLAttrib* attrib_list);
EGLBoolean(GLAPIENTRY* fTerminate)(EGLDisplay dpy);
EGLSurface(GLAPIENTRY* fGetCurrentSurface)(EGLint);
EGLContext(GLAPIENTRY* fGetCurrentContext)(void);