Commit 97bb5a64 by Tim Van Patten Committed by Commit Bot

Implement EGL_CreatePlatformWindowSurface()

The function EGL_CreatePlatformWindowSurface() was introduced by EGL 1.5 and is required by dEQP starting with 3.2.6. ANGLE has worked around EGL_CreatePlatformWindowSurface() being unimplemented by submitting conformance on 3.2.5, but Android's internal master uses ToT dEQP so we need to implement this to pass CTS and enable SWANGLE on CuttleFish. Bug: b/157670307 Test: Android CtsDeqpTestCases, CQ Change-Id: Ib21929701c7881a7dc3a22196e48139a5c8e2ddf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2231247Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
parent df2caf5c
......@@ -1027,13 +1027,25 @@ EGLSurface EGLAPIENTRY EGL_CreatePlatformWindowSurface(EGLDisplay dpy,
", "
"const EGLint* attrib_list = 0x%016" PRIxPTR,
(uintptr_t)dpy, (uintptr_t)config, (uintptr_t)native_window, (uintptr_t)attrib_list);
Thread *thread = egl::GetCurrentThread();
egl::Display *display = static_cast<egl::Display *>(dpy);
UNIMPLEMENTED();
thread->setError(EglBadDisplay() << "eglCreatePlatformWindowSurface unimplemented.", GetDebug(),
"eglCreatePlatformWindowSurface", GetDisplayIfValid(display));
return EGL_NO_SURFACE;
Config *configuration = static_cast<Config *>(config);
// Use reinterpret_cast since native_window could be a pointer or an actual value.
EGLNativeWindowType win = reinterpret_cast<EGLNativeWindowType>(native_window);
AttributeMap attributes = AttributeMap::CreateFromAttribArray(attrib_list);
ANGLE_EGL_TRY_RETURN(thread,
ValidateCreateWindowSurface(display, configuration, win, attributes),
"eglCreateWindowSurface", GetDisplayIfValid(display), EGL_NO_SURFACE);
egl::Surface *surface = nullptr;
ANGLE_EGL_TRY_RETURN(thread,
display->createWindowSurface(configuration, win, attributes, &surface),
"eglCreateWindowSurface", GetDisplayIfValid(display), EGL_NO_SURFACE);
return static_cast<EGLSurface>(surface);
}
EGLSurface EGLAPIENTRY EGL_CreatePlatformPixmapSurface(EGLDisplay dpy,
......
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