wayland-egl: Make wl_egl_window a versioned struct
authorMiguel A. Vico <mvicomoya@nvidia.com>
Thu, 20 Jul 2017 00:27:12 +0000 (17:27 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 24 Jul 2017 09:27:52 +0000 (10:27 +0100)
commit2d5d61bc491b6cef08ced8f1ad57b154d4fa5f66
treee03926206e5097cbda26e5d7007004ff47fa0eca
parent63c251e38f9b4ac3606094a72c8c5b658402f3d0
wayland-egl: Make wl_egl_window a versioned struct

We need wl_egl_window to be a versioned struct in order to keep track of
ABI changes.

This change makes the first member of wl_egl_window the version number.

An heuristic in the wayland driver is added so that we don't break
backwards compatibility:

 - If the first field (version) is an actual pointer, it is an old
   implementation of wl_egl_window, and version points to the wl_surface
   proxy.

 - Else, the first field is the version number, and we have
   wl_egl_window::surface pointing to the wl_surface proxy.

Signed-off-by: Miguel A. Vico <mvicomoya@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/platform_wayland.c
src/egl/wayland/wayland-egl/wayland-egl-priv.h
src/egl/wayland/wayland-egl/wayland-egl.c