On 6 January 2016 at 21:56, Frank Henigman <fjhenig...@google.com> wrote:
> Implement the platform hook of waffle_display_info_json() so it can
> pick up egl-specific information.
>
> Signed-off-by: Frank Henigman <fjhenig...@google.com>
> ---
>  src/waffle/egl/wegl_display.c  | 32 ++++++++++++++++++++++++++++++--
>  src/waffle/egl/wegl_display.h  |  4 ++++
>  src/waffle/egl/wegl_platform.h |  3 +++
>  3 files changed, 37 insertions(+), 2 deletions(-)
>
> diff --git a/src/waffle/egl/wegl_display.c b/src/waffle/egl/wegl_display.c
> index 88fce7a..dcfe934 100644
> --- a/src/waffle/egl/wegl_display.c
> +++ b/src/waffle/egl/wegl_display.c
> @@ -25,6 +25,8 @@
>
>  #include <assert.h>
>
> +#include "json.h"
> +
>  #include "wcore_error.h"
>  #include "wcore_platform.h"
>
> @@ -63,7 +65,6 @@ wegl_display_init(struct wegl_display *dpy,
>  {
>      struct wegl_platform *plat = wegl_platform(wc_plat);
>      bool ok;
> -    EGLint major, minor;
>
>      ok = wcore_display_init(&dpy->wcore, wc_plat);
>      if (!ok)
> @@ -75,7 +76,7 @@ wegl_display_init(struct wegl_display *dpy,
>          goto fail;
>      }
>
> -    ok = plat->eglInitialize(dpy->egl, &major, &minor);
> +    ok = plat->eglInitialize(dpy->egl, &plat->major, &plat->minor);
>      if (!ok) {
>          wegl_emit_error(plat, "eglInitialize");
>          goto fail;
> @@ -139,3 +140,30 @@ wegl_display_supports_context_api(struct wcore_display 
> *wc_dpy,
>
>      return wc_plat->vtbl->dl_can_open(wc_plat, waffle_dl);
>  }
> +
> +void
> +wegl_display_info_json(struct wcore_display *wc_dpy, struct json *jj)
> +{
> +    struct wegl_display *dpy = wegl_display(wc_dpy);
> +    struct wegl_platform *plat = wegl_platform(dpy->wcore.platform);
> +
> +    const char *version = plat->eglQueryString(dpy->egl, EGL_VERSION);
> +    const char *vendor = plat->eglQueryString(dpy->egl, EGL_VENDOR);
> +#ifdef EGL_VERSION_1_2
> +    const char *apis = plat->eglQueryString(dpy->egl, EGL_CLIENT_APIS);
> +#endif
I would suggesting adding the define on top ifndef EGL_VERSION_1_2,
and dropping the checks here and below.

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

Reply via email to