[PATCH weston 3/4] gl-renderer: use eglCreatePlatformWindowSurfaceEXT to get EGLSurfaces

Bill Spitzak spitzak at gmail.com
Fri Mar 20 14:32:47 PDT 2015


>    static int
>    gl_renderer_output_create(struct weston_output *output,
>                              Window xid,
>                              const EGLint *attribs,
>                              const EGLint *visual_id)
>    {
>      ...
>      if (gr->create_platform_window) {
>        go->egl_surface =
>          gr->create_platform_window(gr->egl_display,
>                                     egl_config,
>                                     (void*)&xid,
>                                     NULL);
>      } else
>        go->egl_surface =
>          eglCreateWindowSurface(gr->egl_display,
>                                 egl_config,
>                                 (EGLNativeWindowType)xid,
>                                 NULL);
>    }

The void* cast has to read "xid ? (void*)&xid : (void*)0" to handle the 
NULL correctly that other calls use.

If in fact it actually *writes* the xid (does it?) then the argument has 
to be a Window* xid_p, and this argument is is just (void*)xid_p while 
the second one is xid_p?*xid_p:0. I find this doubtful as that would 
require many changes to the calling code to handle the xid changing.




More information about the wayland-devel mailing list