ecore_wl2: Add API to get dmabuf protocol object
authorDerek Foreman <derekf@osg.samsung.com>
Mon, 11 Apr 2016 21:09:12 +0000 (16:09 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 19 Apr 2016 19:11:09 +0000 (15:11 -0400)
src/lib/ecore_wl2/Ecore_Wl2.h
src/lib/ecore_wl2/ecore_wl2_display.c

index fd2e9d1..49302fa 100644 (file)
@@ -326,6 +326,28 @@ EAPI struct wl_display *ecore_wl2_display_get(Ecore_Wl2_Display *display);
 EAPI struct wl_shm *ecore_wl2_display_shm_get(Ecore_Wl2_Display *display);
 
 /**
+ * Retrieve the wl_dmabuf from a given Ecore_Wl2_Display
+ *
+ *
+ * @param display The Ecore_Wl2_Display for which to retrieve the existing
+ *                Wayland dmabuf interface from
+ *
+ *
+ * @return The wl_dmabuf which this Ecore_Wl2_Display is using
+ *
+ * @ingroup Ecore_Wl2_Display_Group
+ *
+ * @note This is intended for client use only and should be used only
+ *       after ecore_wl2_display_connect().  Also, the return type is
+ *       void * instead of zpw_linux_dmabuf_v1 * since we don't want
+ *       to change our public API every time the version changes in
+ *       wayland-protocols.
+ *
+ * @since 1.18
+ */
+EAPI void * ecore_wl2_display_dmabuf_get(Ecore_Wl2_Display *display);
+
+/**
  * Return an Eina_Iterator that can be used to iterate through globals
  *
  * @param display The Ecore_Wl2_Display for which to return a global iterator
index 42ea79d..27f7bc8 100644 (file)
@@ -703,6 +703,13 @@ ecore_wl2_display_shm_get(Ecore_Wl2_Display *display)
    return display->wl.shm;
 }
 
+EAPI void *
+ecore_wl2_display_dmabuf_get(Ecore_Wl2_Display *display)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
+   return display->wl.dmabuf;
+}
+
 EAPI Eina_Iterator *
 ecore_wl2_display_globals_get(Ecore_Wl2_Display *display)
 {