Commit 4298123b by Corentin Wallez

DisplayGLX: handle EGL_DEFAULT_DISPLAY for ANGLE_platform_angle

BUG=angleproject:892 Change-Id: I681e2b92ac2e8b853c7d1271a5518c4b77a67929 Reviewed-on: https://chromium-review.googlesource.com/270260Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent c337e7ab
...@@ -62,6 +62,18 @@ egl::Error DisplayGLX::initialize(egl::Display *display) ...@@ -62,6 +62,18 @@ egl::Error DisplayGLX::initialize(egl::Display *display)
mEGLDisplay = display; mEGLDisplay = display;
mXDisplay = display->getNativeDisplayId(); mXDisplay = display->getNativeDisplayId();
// ANGLE_platform_angle allows the creation of a default display
// using EGL_DEFAULT_DISPLAY (= nullptr). In this case just open
// the display specified by the DISPLAY environment variable.
if (mXDisplay == EGL_DEFAULT_DISPLAY)
{
mXDisplay = XOpenDisplay(NULL);
if (!mXDisplay)
{
return egl::Error(EGL_NOT_INITIALIZED, "Could not open the default X display.");
}
}
egl::Error glxInitResult = mGLX.initialize(mXDisplay); egl::Error glxInitResult = mGLX.initialize(mXDisplay);
if (glxInitResult.isError()) if (glxInitResult.isError())
{ {
......
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