mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
dmabuf: Add gdk_dmabuf_is_disjoint()
No users yet, but Vulkan will use this later. So have it available already.
This commit is contained in:
parent
98f02f6221
commit
beb9e0c906
@ -527,4 +527,27 @@ gdk_dmabuf_sanitize (GdkDmabuf *dest,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* gdk_dmabuf_is_disjoint:
|
||||
* @dmabuf: a sanitized GdkDmabuf
|
||||
*
|
||||
* A dmabuf is considered disjoint if it uses more than
|
||||
* 1 file descriptor.
|
||||
*
|
||||
* Returns: %TRUE if the dmabuf is disjoint
|
||||
**/
|
||||
gboolean
|
||||
gdk_dmabuf_is_disjoint (const GdkDmabuf *dmabuf)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 1; i < dmabuf->n_planes; i++)
|
||||
{
|
||||
if (dmabuf->planes[0].fd != dmabuf->planes[i].fd)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#endif /* HAVE_LINUX_DMA_BUF_H */
|
||||
|
@ -48,4 +48,6 @@ gboolean gdk_dmabuf_sanitize (GdkDmabuf
|
||||
gsize height,
|
||||
const GdkDmabuf *src,
|
||||
GError **error);
|
||||
gboolean gdk_dmabuf_is_disjoint (const GdkDmabuf *dmabuf);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user