On 18 October 2016 at 17:58, Chad Versace <chadvers...@chromium.org> wrote:
> Tested against Mesa master@8c78fdb with `ninja check-func` on Linux.
> ---
>  src/waffle/egl/wegl_display.c  | 22 ++++++++++++++++++----
>  src/waffle/egl/wegl_platform.c | 35 +++++++++++++++++++++++++++++++++--
>  src/waffle/egl/wegl_platform.h |  8 ++++++++
>  3 files changed, 59 insertions(+), 6 deletions(-)
>
> diff --git a/src/waffle/egl/wegl_display.c b/src/waffle/egl/wegl_display.c
> index 7a7986c..c924f2a 100644
> --- a/src/waffle/egl/wegl_display.c
> +++ b/src/waffle/egl/wegl_display.c
> @@ -104,10 +104,24 @@ wegl_display_init(struct wegl_display *dpy,
>      if (!ok)
>          goto fail;
>
> -    dpy->egl = plat->eglGetDisplay((EGLNativeDisplayType) native_display);
> -    if (!dpy->egl) {
> -        wegl_emit_error(plat, "eglGetDisplay");
> -        goto fail;
> +    if (wegl_platform_can_use_eglGetPlatformDisplay(plat)) {
> +        void *fixed_native_dpy = native_display;
> +        if (plat->egl_platform == EGL_PLATFORM_X11_KHR)
> +            fixed_native_dpy = &native_display;
> +
Silly question: wasn't the fixup applicable only for the window/pixmap surface ?


> +        dpy->egl = plat->eglGetPlatformDisplay(plat->egl_platform,
> +                                               fixed_native_dpy,
> +                                               NULL);
> +        if (!dpy->egl) {
> +            wegl_emit_error(plat, "eglGetPlatformDisplay");
> +            goto fail;
> +        }
Wondering if falling back to eglGetDisplay() is a smart idea in this case?
How about EGL_EXT_platform_base/eglGetPlatformDisplayEXT (admittedly
there's no support for it atm, but it's trivial to do so) ?

Emil
_______________________________________________
waffle mailing list
waffle@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/waffle

Reply via email to