forked from enlightenment/efl
evas: Add wayland dmabuf native surface type
Add the structures required for supporting dmabuf native surfaces
This commit is contained in:
parent
0a6cdcc58c
commit
72b1997f06
|
@ -2560,6 +2560,7 @@ typedef enum _Evas_Native_Surface_Type
|
|||
EVAS_NATIVE_SURFACE_WL, /**< Wayland system based type. buffer of surface */
|
||||
EVAS_NATIVE_SURFACE_TBM, /**< Tizen system based type. tbm surface @since 1.14 */
|
||||
EVAS_NATIVE_SURFACE_EVASGL, /**< Evas GL based type. evas gl surface @since 1.14 */
|
||||
EVAS_NATIVE_SURFACE_WL_DMABUF, /**< Wayland system based type. using dmabuf @since 1.18 */
|
||||
} Evas_Native_Surface_Type;
|
||||
|
||||
/**
|
||||
|
@ -2613,6 +2614,11 @@ struct _Evas_Native_Surface
|
|||
void *legacy_buffer; /**< wayland client buffer to use */
|
||||
} wl; /**< Set this struct fields if surface data is Wayland based. */
|
||||
struct
|
||||
{
|
||||
void *attr; /**< Pointer to dmabuf attributes - contents copied */
|
||||
void *resource; /**< Wayland resource pointer, kept as is */
|
||||
} wl_dmabuf; /**< Set this struct fields if surface data is Wayland dmabuf based. @since 1.18 */
|
||||
struct
|
||||
{
|
||||
void *buffer; /**< tbm surface buffer to use @since 1.14 */
|
||||
} tbm; /**< Set this struct fields if surface data is Tizen based. @since 1.14 */
|
||||
|
|
|
@ -29,6 +29,25 @@
|
|||
|
||||
//#include <Evas_Common.h>
|
||||
|
||||
struct dmabuf_attributes
|
||||
{
|
||||
/* This must exactly match the struct in Enlightenment.
|
||||
* Wayland dmabuf is still an experimental protocol and may
|
||||
* change. If the version doesn't match we won't even attempt
|
||||
* to read the struct.
|
||||
*/
|
||||
int version;
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
uint32_t format;
|
||||
uint32_t flags; /* enum zlinux_buffer_params_flags */
|
||||
int n_planes;
|
||||
int fd[4];
|
||||
uint32_t offset[4];
|
||||
uint32_t stride[4];
|
||||
uint64_t modifier[4];
|
||||
};
|
||||
|
||||
typedef struct _Native Native;
|
||||
struct _Native
|
||||
{
|
||||
|
@ -54,6 +73,18 @@ struct _Native
|
|||
void *surface; /*egl surface*/
|
||||
} wl_surface; /**< Set this struct fields if surface data is Wayland based. */
|
||||
|
||||
/* EVAS_NATIVE_SURFACE_WL_DMABUF */
|
||||
struct
|
||||
{
|
||||
struct dmabuf_attributes attr; /* Plane attributes of buffer */
|
||||
void *resource; /* Wayland resource for buffer */
|
||||
|
||||
// Run-time storage for bind/unbind
|
||||
size_t size; /* size of are when mmapped */
|
||||
void *ptr; /* data area when mmapped */
|
||||
void *image; /* EGLImage when bound for GL */
|
||||
} wl_surface_dmabuf; /**< Set this struct fields if surface data is Wayland dmabuf based. */
|
||||
|
||||
/* EVAS_NATIVE_SURFACE_OPENGL */
|
||||
struct
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue