On Thu, 30 Jun 2016 06:26:11 +0200
Armin Krezović <krezovic.ar...@gmail.com> wrote:

> On 27.06.2016 15:08, Pekka Paalanen wrote:
> >> diff --git a/src/gl-renderer.c b/src/gl-renderer.c
> >> index 23c0cd7..28c0b50 100644
> >> --- a/src/gl-renderer.c
> >> +++ b/src/gl-renderer.c
> >> @@ -2873,6 +2878,43 @@ platform_to_extension(EGLenum platform)
> >>  }
> >>  
> >>  static int
> >> +gl_renderer_create_pbuffer_surface(struct gl_renderer *gr) {  
> > 
> > Style-wise, this function could just take a EGLDisplay as an argument,
> > and return the EGLSurface. That way the setting of dummy_surface would
> > be in the caller, which would make it easier to read.
> >   
> >> +  EGLConfig pbuffer_config;
> >> +
> >> +  static const EGLint pbuffer_config_attribs[] = {
> >> +          EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
> >> +          EGL_RED_SIZE, 1,
> >> +          EGL_GREEN_SIZE, 1,
> >> +          EGL_BLUE_SIZE, 1,
> >> +          EGL_ALPHA_SIZE, 0,
> >> +          EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
> >> +          EGL_NONE
> >> +  };
> >> +
> >> +  static const EGLint pbuffer_attribs[] = {
> >> +          EGL_WIDTH, 10,
> >> +          EGL_HEIGHT, 10,
> >> +          EGL_NONE
> >> +  };
> >> +
> >> +  if (egl_choose_config(gr, pbuffer_config_attribs, NULL, 0, 
> >> &pbuffer_config) < 0) {
> >> +          weston_log("failed to choose EGL config for PbufferSurface");
> >> +          return -1;
> >> +  }
> >> +
> >> +  gr->dummy_surface = eglCreatePbufferSurface(gr->egl_display,
> >> +                                              pbuffer_config,
> >> +                                              pbuffer_attribs);
> >> +
> >> +  if (gr->dummy_surface == EGL_NO_SURFACE) {
> >> +          weston_log("failed to create PbufferSurface\n");
> >> +          return -1;
> >> +  }
> >> +
> >> +  return 0;
> >> +}
> >> +  
> 
> I've been looking at this. If I choose to pass EGLDisplay and return an
> EGLSurface from this function, I can't use egl_choose_config. Instead,
> I'd have to manually call eglGetConfigs and eglChooseConfig. So, I'd
> rather not do this, unless you really, really want it.

Hi Armin,

ok, that's fine. I missed the 'gr' argument to egl_choose_config.


Thanks,
pq

Attachment: pgpmXtx4LR3XE.pgp
Description: OpenPGP digital signature

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to