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

Bill Spitzak spitzak at gmail.com
Fri Mar 20 14:26:11 PDT 2015



On 03/20/2015 06:33 AM, Daniel Stone wrote:
> On Thursday, March 19, 2015, Bill Spitzak <spitzak at gmail.com
> <mailto:spitzak at gmail.com>> wrote:
>
>     On 03/19/2015 07:07 AM, Jonny Lamb wrote:
>
>         -       if (gl_renderer->output_create(&__output->base,
>         output->surface,
>         +       if (gl_renderer->output_create(&__output->base,
>         +                                      output->surface,
>         output->surface,
>                                                 gl_renderer->opaque_attribs,
>                                                 &format) < 0) {
>
>
>     I don't see the need for the duplicate arguments here. Both are
>     obviously the same value (the xid), it's just that one of the API's
>     declares this as EGLNativeWindowType and the other as void*. I think
>     it would be best to hide all this ugliness and make output_create
>     take an xid.
>
>
> Keep reading through the diff until you see compositor-x11.c, which has
> a comment explaining why it's necessary. Passing an XID directly doesn't
> help at all.

Yes I saw that, that is what I was basing my suggestion on. What I was 
thinking is that output_create only takes an xid and is implemented 
something like this:

   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);
   }


More information about the wayland-devel mailing list