Commit 6811a316 by Jamie Madill Committed by Commit Bot

Use GetPlatformDisplay instead of GetPlatformDisplayEXT.

This will allow us to use EGLAttrib and pass pointers as Display init parameters if necessary. BUG=angleproject:2042 Change-Id: Ib0f85d71bc9d3dff2db9453012f40303f3c3bd7c Reviewed-on: https://chromium-review.googlesource.com/513518Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 9d7d719c
...@@ -219,7 +219,7 @@ gl::Error HLSLCompiler::compileToBinary(gl::InfoLog &infoLog, const std::string ...@@ -219,7 +219,7 @@ gl::Error HLSLCompiler::compileToBinary(gl::InfoLog &infoLog, const std::string
infoLog.appendSanitized(message.c_str()); infoLog.appendSanitized(message.c_str());
// This produces unbelievable amounts of spam in about:gpu. // This produces unbelievable amounts of spam in about:gpu.
//WARN() << std::endl << hlsl; // WARN() << std::endl << hlsl;
WARN() << std::endl << message; WARN() << std::endl << message;
......
...@@ -123,7 +123,12 @@ Error ValidateCompatibleConfigs(const Display *display, ...@@ -123,7 +123,12 @@ Error ValidateCompatibleConfigs(const Display *display,
const Config *config2, const Config *config2,
EGLint surfaceType); EGLint surfaceType);
Error ValidatePlatformType(const ClientExtensions &clientExtensions, EGLint platformType); Error ValidateGetPlatformDisplay(EGLenum platform,
} // namespace gl void *native_display,
const EGLAttrib *attrib_list);
Error ValidateGetPlatformDisplayEXT(EGLenum platform,
void *native_display,
const EGLint *attrib_list);
} // namespace egl
#endif // LIBANGLE_VALIDATIONEGL_H_ #endif // LIBANGLE_VALIDATIONEGL_H_
...@@ -1196,9 +1196,29 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplay(EGLenum platform, ...@@ -1196,9 +1196,29 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplay(EGLenum platform,
platform, native_display, attrib_list); platform, native_display, attrib_list);
Thread *thread = GetCurrentThread(); Thread *thread = GetCurrentThread();
UNIMPLEMENTED(); Error err = ValidateGetPlatformDisplay(platform, native_display, attrib_list);
thread->setError(Error(EGL_BAD_DISPLAY, "eglGetPlatformDisplay unimplemented.")); thread->setError(err);
return EGL_NO_DISPLAY; if (err.isError())
{
return EGL_NO_DISPLAY;
}
if (platform == EGL_PLATFORM_ANGLE_ANGLE)
{
return Display::GetDisplayFromNativeDisplay(
gl::bitCast<EGLNativeDisplayType>(native_display),
AttributeMap::CreateFromAttribArray(attrib_list));
}
else if (platform == EGL_PLATFORM_DEVICE_EXT)
{
Device *eglDevice = reinterpret_cast<Device *>(native_display);
return Display::GetDisplayFromDevice(eglDevice);
}
else
{
UNREACHABLE();
return EGL_NO_DISPLAY;
}
} }
EGLSurface EGLAPIENTRY CreatePlatformWindowSurface(EGLDisplay dpy, EGLSurface EGLAPIENTRY CreatePlatformWindowSurface(EGLDisplay dpy,
......
...@@ -161,13 +161,7 @@ bool EGLWindow::initializeGL(OSWindow *osWindow) ...@@ -161,13 +161,7 @@ bool EGLWindow::initializeGL(OSWindow *osWindow)
bool EGLWindow::initializeDisplayAndSurface(OSWindow *osWindow) bool EGLWindow::initializeDisplayAndSurface(OSWindow *osWindow)
{ {
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT")); std::vector<EGLAttrib> displayAttributes;
if (!eglGetPlatformDisplayEXT)
{
return false;
}
std::vector<EGLint> displayAttributes;
displayAttributes.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE); displayAttributes.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE);
displayAttributes.push_back(mPlatform.renderer); displayAttributes.push_back(mPlatform.renderer);
displayAttributes.push_back(EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE); displayAttributes.push_back(EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE);
...@@ -204,9 +198,9 @@ bool EGLWindow::initializeDisplayAndSurface(OSWindow *osWindow) ...@@ -204,9 +198,9 @@ bool EGLWindow::initializeDisplayAndSurface(OSWindow *osWindow)
displayAttributes.push_back(EGL_NONE); displayAttributes.push_back(EGL_NONE);
mDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, mDisplay = eglGetPlatformDisplay(EGL_PLATFORM_ANGLE_ANGLE,
reinterpret_cast<void *>(osWindow->getNativeDisplay()), reinterpret_cast<void *>(osWindow->getNativeDisplay()),
&displayAttributes[0]); &displayAttributes[0]);
if (mDisplay == EGL_NO_DISPLAY) if (mDisplay == EGL_NO_DISPLAY)
{ {
destroyGL(); destroyGL();
......
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