summaryrefslogtreecommitdiff
path: root/src/weston-egl-ext.h
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2015-02-11 18:15:18 +0000
committerBryce Harrington <bryce@osg.samsung.com>2015-02-12 19:31:18 -0800
commitad1218ffe6968faa94bc261c9cc71f030e2ba205 (patch)
treec1cff6916586352618eb09aa3b296306c3c403df /src/weston-egl-ext.h
parente78977196c8a1c74990396f1c97a7a384145abc8 (diff)
downloadweston-ad1218ffe6968faa94bc261c9cc71f030e2ba205.tar.gz
weston-egl-ext: Define EGL tokens harder for old Mesa
Older versions of Mesa provided header definitions for the EGL_WL_bind_wayland_display extension, but an earlier version of the extension which only provided the (un)bind entrypoints, and not QueryWaylandBuffer. Detect this half-provision and make sure we export the QueryWaylandBuffer definitions as well. Fixes build failure with EGL on Ubuntu 12.04. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
Diffstat (limited to 'src/weston-egl-ext.h')
-rw-r--r--src/weston-egl-ext.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/weston-egl-ext.h b/src/weston-egl-ext.h
index 48883233..145322bf 100644
--- a/src/weston-egl-ext.h
+++ b/src/weston-egl-ext.h
@@ -33,6 +33,29 @@
#ifndef EGL_WL_bind_wayland_display
#define EGL_WL_bind_wayland_display 1
+struct wl_display;
+
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
+EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
+#endif
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
+#endif
+
+/*
+ * This is a little different to the tests shipped with EGL implementations,
+ * which wrap the entire thing in #ifndef EGL_WL_bind_wayland_display, then go
+ * on to define both BindWaylandDisplay and QueryWaylandBuffer.
+ *
+ * Unfortunately, some implementations (particularly the version of Mesa shipped
+ * in Ubuntu 12.04) define EGL_WL_bind_wayland_display, but then only provide
+ * prototypes for (Un)BindWaylandDisplay, completely omitting
+ * QueryWaylandBuffer.
+ *
+ * Detect this, and provide our own definitions if necessary.
+ */
+#ifndef EGL_WAYLAND_BUFFER_WL
#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
#define EGL_WAYLAND_PLANE_WL 0x31D6 /* eglCreateImageKHR target */
@@ -41,15 +64,10 @@
#define EGL_TEXTURE_Y_XUXV_WL 0x31D9
#define EGL_TEXTURE_EXTERNAL_WL 0x31DA
-struct wl_display;
struct wl_resource;
#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
-EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
#endif
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
#endif