Skip to content

Commit

Permalink
Add an API to get the EGL platform identifier
Browse files Browse the repository at this point in the history
wpe_renderer_backend_egl_get_display_platform will return either :
- a platform to give to eglGetPlatformDisplay / eglGetPlatformDisplayEXT
- 0 (default if get_display_platform isn't implemented) if we must only use eglGetDisplay

This is needed on new Broadcom STB reference software, where both both client (wayland-egl)
and server (nexus) platforms are in the same library.
  • Loading branch information
hwti committed Nov 27, 2018
1 parent e5553b7 commit 2ae1fee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/wpe/renderer-backend-egl.h
Expand Up @@ -36,6 +36,7 @@
#endif

#include <EGL/eglplatform.h>
#include <EGL/egl.h>
#include <stdint.h>

#ifdef __cplusplus
Expand All @@ -53,8 +54,8 @@ struct wpe_renderer_backend_egl_interface {
void (*destroy)(void*);

EGLNativeDisplayType (*get_native_display)(void*);
EGLenum (*get_display_platform)(void*);

void (*_wpe_reserved0)(void);
void (*_wpe_reserved1)(void);
void (*_wpe_reserved2)(void);
void (*_wpe_reserved3)(void);
Expand Down Expand Up @@ -101,6 +102,10 @@ WPE_EXPORT
EGLNativeDisplayType
wpe_renderer_backend_egl_get_native_display(struct wpe_renderer_backend_egl*);

WPE_EXPORT
EGLenum
wpe_renderer_backend_egl_get_display_platform(struct wpe_renderer_backend_egl*);

WPE_EXPORT
struct wpe_renderer_backend_egl_target*
wpe_renderer_backend_egl_target_create(int);
Expand Down
8 changes: 8 additions & 0 deletions src/renderer-backend-egl.c
Expand Up @@ -61,6 +61,14 @@ wpe_renderer_backend_egl_get_native_display(struct wpe_renderer_backend_egl* bac
return backend->interface->get_native_display(backend->interface_data);
}

EGLenum
wpe_renderer_backend_egl_get_display_platform(struct wpe_renderer_backend_egl* backend)
{
if (backend->interface->get_display_platform)
return backend->interface->get_display_platform(backend->interface_data);
return 0;
}

struct wpe_renderer_backend_egl_target*
wpe_renderer_backend_egl_target_create(int host_fd)
{
Expand Down

0 comments on commit 2ae1fee

Please sign in to comment.