Commit de0105d0 by Nicolas Capens Committed by Nicolas Caramelli

Fix delegating eglCreateWindowSurface to CreatePlatformWindowSurface

Only with X11 does eglCreatePlatformWindowSurface take a pointer to a window handle instead of a handle value directly. Since eglCreateWindowSurface delegates to CreatePlatformWindowSurface, it must take the address of the window handle. Bug: b/168821209 Change-Id: I69c7bf3315a871c2cd806a736fd73606cac34ad2 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/48789Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Caramelli <caramelli.devel@gmail.com>
parent d75c5e18
...@@ -361,9 +361,9 @@ EGLSurface EGLAPIENTRY CreatePlatformWindowSurface(EGLDisplay dpy, EGLConfig con ...@@ -361,9 +361,9 @@ EGLSurface EGLAPIENTRY CreatePlatformWindowSurface(EGLDisplay dpy, EGLConfig con
return EGL_NO_SURFACE; return EGL_NO_SURFACE;
} }
#if defined(USE_X11) #if defined(USE_X11)
native_window = (void *)(*(::Window*)native_window); native_window = (void *)(*(::Window*)native_window);
#endif #endif
if(!display->isValidWindow((EGLNativeWindowType)native_window)) if(!display->isValidWindow((EGLNativeWindowType)native_window))
{ {
...@@ -388,7 +388,12 @@ EGLSurface EGLAPIENTRY CreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGL ...@@ -388,7 +388,12 @@ EGLSurface EGLAPIENTRY CreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGL
"const EGLint *attrib_list = %p)", dpy, config, window, attrib_list); "const EGLint *attrib_list = %p)", dpy, config, window, attrib_list);
EGLAttribs attribs(attrib_list); EGLAttribs attribs(attrib_list);
#if defined(USE_X11)
return CreatePlatformWindowSurface(dpy, config, (void*)&window, &attribs);
#else
return CreatePlatformWindowSurface(dpy, config, (void*)window, &attribs); return CreatePlatformWindowSurface(dpy, config, (void*)window, &attribs);
#endif
} }
EGLSurface EGLAPIENTRY CreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) EGLSurface EGLAPIENTRY CreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
......
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