... because converting attrib to int truncates, and that's bad.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
static EGLDisplay
_eglGetPlatformDisplayCommon(EGLenum platform, void *native_display,
- const EGLint *attrib_list)
+ const EGLAttrib *attrib_list)
{
_EGLDisplay *dpy;
static EGLDisplay EGLAPIENTRY
eglGetPlatformDisplayEXT(EGLenum platform, void *native_display,
- const EGLint *attrib_list)
+ const EGLint *int_attribs)
{
+ EGLAttrib *attrib_list;
+ EGLDisplay display;
+
_EGL_FUNC_START(NULL, EGL_OBJECT_THREAD_KHR, NULL, EGL_NO_DISPLAY);
- return _eglGetPlatformDisplayCommon(platform, native_display, attrib_list);
+
+ if (_eglConvertIntsToAttribs(int_attribs, &attrib_list) != EGL_SUCCESS)
+ RETURN_EGL_ERROR(NULL, EGL_BAD_ALLOC, NULL);
+
+ display = _eglGetPlatformDisplayCommon(platform, native_display, attrib_list);
+ free(attrib_list);
+ return display;
}
EGLDisplay EGLAPIENTRY
eglGetPlatformDisplay(EGLenum platform, void *native_display,
const EGLAttrib *attrib_list)
{
- EGLDisplay display;
- EGLint *int_attribs;
-
_EGL_FUNC_START(NULL, EGL_OBJECT_THREAD_KHR, NULL, EGL_NO_DISPLAY);
-
- int_attribs = _eglConvertAttribsToInt(attrib_list);
- if (attrib_list && !int_attribs)
- RETURN_EGL_ERROR(NULL, EGL_BAD_ALLOC, NULL);
-
- display = _eglGetPlatformDisplayCommon(platform, native_display, int_attribs);
- free(int_attribs);
- return display;
+ return _eglGetPlatformDisplayCommon(platform, native_display, attrib_list);
}
/**
#ifdef HAVE_X11_PLATFORM
static EGLBoolean
-_eglParseX11DisplayAttribList(_EGLDisplay *display, const EGLint *attrib_list)
+_eglParseX11DisplayAttribList(_EGLDisplay *display,
+ const EGLAttrib *attrib_list)
{
int i;
}
for (i = 0; attrib_list[i] != EGL_NONE; i += 2) {
- EGLint attrib = attrib_list[i];
- EGLint value = attrib_list[i + 1];
+ EGLAttrib attrib = attrib_list[i];
+ EGLAttrib value = attrib_list[i + 1];
/* EGL_EXT_platform_x11 recognizes exactly one attribute,
* EGL_PLATFORM_X11_SCREEN_EXT, which is optional.
_EGLDisplay*
_eglGetX11Display(Display *native_display,
- const EGLint *attrib_list)
+ const EGLAttrib *attrib_list)
{
_EGLDisplay *display = _eglFindDisplay(_EGL_PLATFORM_X11,
native_display);
#ifdef HAVE_DRM_PLATFORM
_EGLDisplay*
_eglGetGbmDisplay(struct gbm_device *native_display,
- const EGLint *attrib_list)
+ const EGLAttrib *attrib_list)
{
/* EGL_MESA_platform_gbm recognizes no attributes. */
if (attrib_list != NULL && attrib_list[0] != EGL_NONE) {
#ifdef HAVE_WAYLAND_PLATFORM
_EGLDisplay*
_eglGetWaylandDisplay(struct wl_display *native_display,
- const EGLint *attrib_list)
+ const EGLAttrib *attrib_list)
{
/* EGL_EXT_platform_wayland recognizes no attributes. */
if (attrib_list != NULL && attrib_list[0] != EGL_NONE) {
#ifdef HAVE_SURFACELESS_PLATFORM
_EGLDisplay*
_eglGetSurfacelessDisplay(void *native_display,
- const EGLint *attrib_list)
+ const EGLAttrib *attrib_list)
{
/* This platform has no native display. */
if (native_display != NULL) {
#ifdef HAVE_X11_PLATFORM
_EGLDisplay*
-_eglGetX11Display(Display *native_display, const EGLint *attrib_list);
+_eglGetX11Display(Display *native_display, const EGLAttrib *attrib_list);
#endif
#ifdef HAVE_DRM_PLATFORM
_EGLDisplay*
_eglGetGbmDisplay(struct gbm_device *native_display,
- const EGLint *attrib_list);
+ const EGLAttrib *attrib_list);
#endif
#ifdef HAVE_WAYLAND_PLATFORM
_EGLDisplay*
_eglGetWaylandDisplay(struct wl_display *native_display,
- const EGLint *attrib_list);
+ const EGLAttrib *attrib_list);
#endif
#ifdef HAVE_SURFACELESS_PLATFORM
_EGLDisplay*
_eglGetSurfacelessDisplay(void *native_display,
- const EGLint *attrib_list);
+ const EGLAttrib *attrib_list);
#endif
#ifdef __cplusplus