Internally, much of the EGL code uses EGLNativeDisplayType,
EGLNativeWindowType, and EGLPixmapType. However, the EGLNative type
often does not match the variable's actual type.
The concept of EGLNative types are a bad match for Linux, as explained
below. And the EGL platform extensions don't use EGLNative types at all.
Those extensions attempt to solve cross-platform issues by moving the
EGL API away from the EGLNative types.
The core of the problem is that eglplatform.h can define each EGLNative
type once only, but Linux supports multiple EGL platforms.
To work around the problem, Mesa's eglplatform.h contains multiple
definitions of each EGLNative type, selected by feature macros. Mesa
expects EGL clients to set the feature macro approrpiately. But the
feature macros don't work when a single codebase must be built with
support for multiple EGL platforms, *such as Mesa itself*.
When building libEGL, autotools chooses the EGLNative typedefs based on
the first element of '--with-egl-platforms'. For example,
'--with-egl-platforms=x11,drm,wayland' defines the following:
typedef Display* EGLNativeDisplayType;
typedef Window EGLNativeWindowType;
typedef Pixmap EGLNativePixmapType;
Clearly, this doesn't work well for Wayland and GBM. Mesa works around
the problem by casting the EGLNative types to different things in
different files.
For sanity's sake, and to prepare for the EGL platform extensions, this
patch removes from egl/main and egl/dri2 all internal use of the
EGLNative types. It replaces them with 'void*' and checks each explicit
cast with a static assertion. Also, the patch touches egl_gallium the
minimal amount to keep it compatible with eglapi.h.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 files changed:
static _EGLSurface*
dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *dpy,
static _EGLSurface*
dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *dpy,
- _EGLConfig *conf, EGLNativeWindowType window,
+ _EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->create_window_surface(drv, dpy, conf, window,
+ return dri2_dpy->vtbl->create_window_surface(drv, dpy, conf, native_window,
attrib_list);
}
static _EGLSurface*
dri2_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *dpy,
attrib_list);
}
static _EGLSurface*
dri2_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *dpy,
- _EGLConfig *conf, EGLNativePixmapType pixmap,
+ _EGLConfig *conf, void *native_pixmap,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->create_pixmap_surface(drv, dpy, conf, pixmap,
+ return dri2_dpy->vtbl->create_pixmap_surface(drv, dpy, conf, native_pixmap,
static EGLBoolean
dri2_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
static EGLBoolean
dri2_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
- EGLNativePixmapType target)
+ void *native_pixmap_target)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->copy_buffers(drv, dpy, surf, target);
+ return dri2_dpy->vtbl->copy_buffers(drv, dpy, surf, native_pixmap_target);
_EGLSurface* (*create_window_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLConfig *config,
_EGLSurface* (*create_window_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLConfig *config,
- EGLNativeWindowType window,
const EGLint *attrib_list);
_EGLSurface* (*create_pixmap_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLConfig *config,
const EGLint *attrib_list);
_EGLSurface* (*create_pixmap_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLConfig *config,
- EGLNativePixmapType pixmap,
const EGLint *attrib_list);
_EGLSurface* (*create_pbuffer_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
const EGLint *attrib_list);
_EGLSurface* (*create_pbuffer_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
EGLint width, EGLint height);
EGLBoolean (*copy_buffers)(_EGLDriver *drv, _EGLDisplay *dpy,
EGLint width, EGLint height);
EGLBoolean (*copy_buffers)(_EGLDriver *drv, _EGLDisplay *dpy,
- _EGLSurface *surf, EGLNativePixmapType target);
+ _EGLSurface *surf, void *native_pixmap_target);
EGLint (*query_buffer_age)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf);
EGLint (*query_buffer_age)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf);
static inline _EGLSurface *
dri2_fallback_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf,
static inline _EGLSurface *
dri2_fallback_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf,
- EGLNativePixmapType pixmap,
const EGLint *attrib_list)
{
return NULL;
const EGLint *attrib_list)
{
return NULL;
static inline EGLBoolean
dri2_fallback_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf,
static inline EGLBoolean
dri2_fallback_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf,
- EGLNativePixmapType target)
+ void *native_pixmap_target)
static _EGLSurface *
droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
static _EGLSurface *
droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
- _EGLConfig *conf, EGLNativeWindowType window,
+ _EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf;
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf;
+ struct ANativeWindow *window = native_window;
+
dri2_surf = calloc(1, sizeof *dri2_surf);
if (!dri2_surf) {
_eglError(EGL_BAD_ALLOC, "droid_create_surface");
dri2_surf = calloc(1, sizeof *dri2_surf);
if (!dri2_surf) {
_eglError(EGL_BAD_ALLOC, "droid_create_surface");
static _EGLSurface *
droid_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
static _EGLSurface *
droid_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLConfig *conf, EGLNativeWindowType window,
- const EGLint *attrib_list)
+ _EGLConfig *conf, void *native_window,
+ const EGLint *attrib_list)
{
return droid_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
{
return droid_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
+ native_window, attrib_list);
static _EGLSurface *
dri2_drm_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
static _EGLSurface *
dri2_drm_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
- _EGLConfig *conf, EGLNativeWindowType window,
+ _EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf;
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf;
+ struct gbm_surface *window = native_window;
struct gbm_dri_surface *surf;
(void) drv;
struct gbm_dri_surface *surf;
(void) drv;
case EGL_WINDOW_BIT:
if (!window)
return NULL;
case EGL_WINDOW_BIT:
if (!window)
return NULL;
- surf = gbm_dri_surface((struct gbm_surface *) window);
+ surf = gbm_dri_surface(window);
dri2_surf->gbm_surf = surf;
dri2_surf->base.Width = surf->base.width;
dri2_surf->base.Height = surf->base.height;
dri2_surf->gbm_surf = surf;
dri2_surf->base.Width = surf->base.width;
dri2_surf->base.Height = surf->base.height;
static _EGLSurface *
dri2_drm_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
static _EGLSurface *
dri2_drm_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLConfig *conf, EGLNativeWindowType window,
+ _EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
return dri2_drm_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
const EGLint *attrib_list)
{
return dri2_drm_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
+ native_window, attrib_list);
*/
static _EGLSurface *
dri2_wl_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
*/
static _EGLSurface *
dri2_wl_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
- _EGLConfig *conf, EGLNativeWindowType window,
+ _EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
+ struct wl_egl_window *window = native_window;
struct dri2_egl_surface *dri2_surf;
(void) drv;
struct dri2_egl_surface *dri2_surf;
(void) drv;
switch (type) {
case EGL_WINDOW_BIT:
switch (type) {
case EGL_WINDOW_BIT:
- dri2_surf->wl_win = (struct wl_egl_window *) window;
+ dri2_surf->wl_win = window;
dri2_surf->wl_win->private = dri2_surf;
dri2_surf->wl_win->resize_callback = resize_callback;
dri2_surf->wl_win->private = dri2_surf;
dri2_surf->wl_win->resize_callback = resize_callback;
*/
static _EGLSurface *
dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
*/
static _EGLSurface *
dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLConfig *conf, EGLNativeWindowType window,
+ _EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_EGLSurface *surf;
surf = dri2_wl_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_EGLSurface *surf;
surf = dri2_wl_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
+ native_window, attrib_list);
if (surf != NULL)
dri2_wl_swap_interval(drv, disp, surf, dri2_dpy->default_swap_interval);
if (surf != NULL)
dri2_wl_swap_interval(drv, disp, surf, dri2_dpy->default_swap_interval);
*/
static _EGLSurface *
dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
*/
static _EGLSurface *
dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
- _EGLConfig *conf, EGLNativeWindowType native_window,
+ _EGLConfig *conf, void *native_surface,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
xcb_get_geometry_reply_t *reply;
xcb_screen_iterator_t s;
xcb_generic_error_t *error;
xcb_get_geometry_reply_t *reply;
xcb_screen_iterator_t s;
xcb_generic_error_t *error;
- xcb_drawable_t window = (uintptr_t )native_window;
+ xcb_drawable_t drawable;
+
+ STATIC_ASSERT(sizeof(uintptr_t) == sizeof(native_surface));
+ drawable = (uintptr_t) native_surface;
dri2_surf->drawable, s.data->root,
dri2_surf->base.Width, dri2_surf->base.Height);
} else {
dri2_surf->drawable, s.data->root,
dri2_surf->base.Width, dri2_surf->base.Height);
} else {
- dri2_surf->drawable = window;
+ dri2_surf->drawable = drawable;
*/
static _EGLSurface *
dri2_x11_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
*/
static _EGLSurface *
dri2_x11_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLConfig *conf, EGLNativeWindowType window,
+ _EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_EGLSurface *surf;
surf = dri2_x11_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_EGLSurface *surf;
surf = dri2_x11_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
+ native_window, attrib_list);
if (surf != NULL) {
/* When we first create the DRI2 drawable, its swap interval on the
* server side is 1.
if (surf != NULL) {
/* When we first create the DRI2 drawable, its swap interval on the
* server side is 1.
static _EGLSurface *
dri2_x11_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
static _EGLSurface *
dri2_x11_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLConfig *conf, EGLNativePixmapType pixmap,
+ _EGLConfig *conf, void *native_pixmap,
const EGLint *attrib_list)
{
return dri2_x11_create_surface(drv, disp, EGL_PIXMAP_BIT, conf,
const EGLint *attrib_list)
{
return dri2_x11_create_surface(drv, disp, EGL_PIXMAP_BIT, conf,
+ native_pixmap, attrib_list);
static EGLBoolean
dri2_x11_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
static EGLBoolean
dri2_x11_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
- EGLNativePixmapType native_target)
+ void *native_pixmap_target)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
xcb_gcontext_t gc;
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
xcb_gcontext_t gc;
- xcb_pixmap_t target = (uintptr_t )native_target;
+ xcb_pixmap_t target;
+
+ STATIC_ASSERT(sizeof(uintptr_t) == sizeof(native_pixmap_target));
+ target = (uintptr_t) native_pixmap_target;
EGLDisplay EGLAPIENTRY
eglGetDisplay(EGLNativeDisplayType nativeDisplay)
{
EGLDisplay EGLAPIENTRY
eglGetDisplay(EGLNativeDisplayType nativeDisplay)
{
- _EGLPlatformType plat = _eglGetNativePlatform(nativeDisplay);
- _EGLDisplay *dpy = _eglFindDisplay(plat, (void *) nativeDisplay);
+ _EGLPlatformType plat;
+ _EGLDisplay *dpy;
+ void *native_display_ptr;
+
+ STATIC_ASSERT(sizeof(void*) == sizeof(nativeDisplay));
+ native_display_ptr = (void*) nativeDisplay;
+
+ plat = _eglGetNativePlatform(native_display_ptr);
+ dpy = _eglFindDisplay(plat, native_display_ptr);
return _eglGetDisplayHandle(dpy);
}
return _eglGetDisplayHandle(dpy);
}
_EGLDriver *drv;
_EGLSurface *surf;
EGLSurface ret;
_EGLDriver *drv;
_EGLSurface *surf;
EGLSurface ret;
+ void *native_window_ptr;
+
+ STATIC_ASSERT(sizeof(void*) == sizeof(window));
+ native_window_ptr = (void*) window;
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
if (disp->Platform != _eglGetNativePlatform(disp->PlatformDisplay))
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
if (disp->Platform != _eglGetNativePlatform(disp->PlatformDisplay))
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
- surf = drv->API.CreateWindowSurface(drv, disp, conf, window, attrib_list);
+ surf = drv->API.CreateWindowSurface(drv, disp, conf, native_window_ptr,
+ attrib_list);
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
_EGLDriver *drv;
_EGLSurface *surf;
EGLSurface ret;
_EGLDriver *drv;
_EGLSurface *surf;
EGLSurface ret;
+ void *native_pixmap_ptr;
+
+ STATIC_ASSERT(sizeof(void*) == sizeof(pixmap));
+ native_pixmap_ptr = (void*) pixmap;
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
if (disp->Platform != _eglGetNativePlatform(disp->PlatformDisplay))
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_PIXMAP, EGL_NO_SURFACE);
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
if (disp->Platform != _eglGetNativePlatform(disp->PlatformDisplay))
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_PIXMAP, EGL_NO_SURFACE);
- surf = drv->API.CreatePixmapSurface(drv, disp, conf, pixmap, attrib_list);
+ surf = drv->API.CreatePixmapSurface(drv, disp, conf, native_pixmap_ptr,
+ attrib_list);
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
_EGLSurface *surf = _eglLookupSurface(surface, disp);
_EGLDriver *drv;
EGLBoolean ret;
_EGLSurface *surf = _eglLookupSurface(surface, disp);
_EGLDriver *drv;
EGLBoolean ret;
+ void *native_pixmap_ptr;
+
+ STATIC_ASSERT(sizeof(void*) == sizeof(target));
+ native_pixmap_ptr = (void*) target;
_EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
if (disp->Platform != _eglGetNativePlatform(disp->PlatformDisplay))
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_PIXMAP, EGL_FALSE);
_EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
if (disp->Platform != _eglGetNativePlatform(disp->PlatformDisplay))
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_PIXMAP, EGL_FALSE);
- ret = drv->API.CopyBuffers(drv, disp, surf, target);
+ ret = drv->API.CopyBuffers(drv, disp, surf, native_pixmap_ptr);
RETURN_EGL_EVAL(disp, ret);
}
RETURN_EGL_EVAL(disp, ret);
}
typedef EGLBoolean (*QueryContext_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx, EGLint attribute, EGLint *value);
/* surface funcs */
typedef EGLBoolean (*QueryContext_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx, EGLint attribute, EGLint *value);
/* surface funcs */
-typedef _EGLSurface *(*CreateWindowSurface_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *config, EGLNativeWindowType window, const EGLint *attrib_list);
-typedef _EGLSurface *(*CreatePixmapSurface_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *config, EGLNativePixmapType pixmap, const EGLint *attrib_list);
+typedef _EGLSurface *(*CreateWindowSurface_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *config, void *native_window, const EGLint *attrib_list);
+typedef _EGLSurface *(*CreatePixmapSurface_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *config, void *native_pixmap, const EGLint *attrib_list);
typedef _EGLSurface *(*CreatePbufferSurface_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *config, const EGLint *attrib_list);
typedef EGLBoolean (*DestroySurface_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface);
typedef EGLBoolean (*QuerySurface_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface, EGLint attribute, EGLint *value);
typedef _EGLSurface *(*CreatePbufferSurface_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *config, const EGLint *attrib_list);
typedef EGLBoolean (*DestroySurface_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface);
typedef EGLBoolean (*QuerySurface_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface, EGLint attribute, EGLint *value);
typedef EGLBoolean (*ReleaseTexImage_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface, EGLint buffer);
typedef EGLBoolean (*SwapInterval_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint interval);
typedef EGLBoolean (*SwapBuffers_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *draw);
typedef EGLBoolean (*ReleaseTexImage_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface, EGLint buffer);
typedef EGLBoolean (*SwapInterval_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint interval);
typedef EGLBoolean (*SwapBuffers_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *draw);
-typedef EGLBoolean (*CopyBuffers_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface, EGLNativePixmapType target);
+typedef EGLBoolean (*CopyBuffers_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface, void *native_pixmap_target);
/* misc funcs */
typedef const char *(*QueryString_t)(_EGLDriver *drv, _EGLDisplay *dpy, EGLint name);
/* misc funcs */
typedef const char *(*QueryString_t)(_EGLDriver *drv, _EGLDisplay *dpy, EGLint name);
* Try detecting native platform with the help of native display characteristcs.
*/
static _EGLPlatformType
* Try detecting native platform with the help of native display characteristcs.
*/
static _EGLPlatformType
-_eglNativePlatformDetectNativeDisplay(EGLNativeDisplayType nativeDisplay)
+_eglNativePlatformDetectNativeDisplay(void *nativeDisplay)
{
#ifdef HAVE_FBDEV_PLATFORM
struct stat buf;
{
#ifdef HAVE_FBDEV_PLATFORM
struct stat buf;
* Return the native platform. It is the platform of the EGL native types.
*/
_EGLPlatformType
* Return the native platform. It is the platform of the EGL native types.
*/
_EGLPlatformType
-_eglGetNativePlatform(EGLNativeDisplayType nativeDisplay)
+_eglGetNativePlatform(void *nativeDisplay)
{
static _EGLPlatformType native_platform = _EGL_INVALID_PLATFORM;
char *detection_method = NULL;
{
static _EGLPlatformType native_platform = _EGL_INVALID_PLATFORM;
char *detection_method = NULL;
-_eglGetNativePlatform(EGLNativeDisplayType nativeDisplay);
+_eglGetNativePlatform(void *nativeDisplay);
static _EGLSurface *
egl_g3d_create_window_surface(_EGLDriver *drv, _EGLDisplay *dpy,
static _EGLSurface *
egl_g3d_create_window_surface(_EGLDriver *drv, _EGLDisplay *dpy,
- _EGLConfig *conf, EGLNativeWindowType win,
+ _EGLConfig *conf, void *native_window,
+ EGLNativeWindowType win;
struct egl_g3d_create_surface_arg arg;
struct egl_g3d_create_surface_arg arg;
+ STATIC_ASSERT(sizeof(EGLNativeWindowType) == sizeof(native_window));
+ win = (EGLNativeWindowType) native_window;
+
memset(&arg, 0, sizeof(arg));
arg.type = EGL_WINDOW_BIT;
arg.u.win = win;
memset(&arg, 0, sizeof(arg));
arg.type = EGL_WINDOW_BIT;
arg.u.win = win;
static _EGLSurface *
egl_g3d_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *dpy,
static _EGLSurface *
egl_g3d_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *dpy,
- _EGLConfig *conf, EGLNativePixmapType pix,
+ _EGLConfig *conf, void *native_pixmap,
+ EGLNativePixmapType pix;
struct egl_g3d_create_surface_arg arg;
struct egl_g3d_create_surface_arg arg;
+ STATIC_ASSERT(sizeof(EGLNativePixmapType) == sizeof(native_pixmap));
+ pix = (EGLNativePixmapType) native_pixmap;
+
memset(&arg, 0, sizeof(arg));
arg.type = EGL_PIXMAP_BIT;
arg.u.pix = pix;
memset(&arg, 0, sizeof(arg));
arg.type = EGL_PIXMAP_BIT;
arg.u.pix = pix;
static EGLBoolean
egl_g3d_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
static EGLBoolean
egl_g3d_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
- EGLNativePixmapType target)
+ void *native_pixmap_target)
{
struct egl_g3d_display *gdpy = egl_g3d_display(dpy);
struct egl_g3d_surface *gsurf = egl_g3d_surface(surf);
_EGLContext *ctx = _eglGetCurrentContext();
{
struct egl_g3d_display *gdpy = egl_g3d_display(dpy);
struct egl_g3d_surface *gsurf = egl_g3d_surface(surf);
_EGLContext *ctx = _eglGetCurrentContext();
+ EGLNativePixmapType target;
+
+ STATIC_ASSERT(sizeof(EGLNativePixmapType) == sizeof(native_pixmap_target));
+ target = (EGLNativePixmapType) native_pixmap_target;
if (!gsurf->render_texture)
return EGL_TRUE;
if (!gsurf->render_texture)
return EGL_TRUE;