diff options
Diffstat (limited to 'src/egl/main')
-rw-r--r-- | src/egl/main/eglapi.c | 31 | ||||
-rw-r--r-- | src/egl/main/eglapi.h | 6 | ||||
-rw-r--r-- | src/egl/main/egldisplay.c | 4 | ||||
-rw-r--r-- | src/egl/main/egldisplay.h | 2 |
4 files changed, 32 insertions, 11 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 950c447de9d..836714ce244 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -296,8 +296,15 @@ _eglUnlockDisplay(_EGLDisplay *dpy) 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); } @@ -529,12 +536,17 @@ eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, _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); - 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); @@ -550,12 +562,17 @@ eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, _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); - 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); @@ -740,11 +757,15 @@ eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target) _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); - ret = drv->API.CopyBuffers(drv, disp, surf, target); + ret = drv->API.CopyBuffers(drv, disp, surf, native_pixmap_ptr); RETURN_EGL_EVAL(disp, ret); } diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h index 091c09cbfa8..f20ce5b701b 100644 --- a/src/egl/main/eglapi.h +++ b/src/egl/main/eglapi.h @@ -58,8 +58,8 @@ typedef EGLBoolean (*MakeCurrent_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurfa 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); @@ -68,7 +68,7 @@ typedef EGLBoolean (*BindTexImage_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurf 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); diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index bed7663efc5..b43e3ea5d9b 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -139,7 +139,7 @@ _eglPointerIsDereferencable(void *p) * 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; @@ -186,7 +186,7 @@ _eglNativePlatformDetectNativeDisplay(EGLNativeDisplayType nativeDisplay) * 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; diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index 0952bc960cf..911a2e9bd67 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -162,7 +162,7 @@ struct _egl_display extern _EGLPlatformType -_eglGetNativePlatform(EGLNativeDisplayType nativeDisplay); +_eglGetNativePlatform(void *nativeDisplay); extern void |