1 #include "evas_engine.h" 2 3 typedef struct _tbm_bufmgr *tbm_bufmgr; 4 typedef struct _tbm_bo *tbm_bo; 5 6 typedef union _tbm_bo_handle 7 { 8 void *ptr; 9 int32_t s32; 10 uint32_t u32; 11 int64_t s64; 12 uint64_t u64; 13 } tbm_bo_handle; 14 15 typedef struct 16 { 17 unsigned int attachment; 18 unsigned int name; 19 unsigned int pitch; 20 unsigned int cpp; 21 unsigned int flags; 22 } DRI2Buffer; 23 24 #define DRI2_BUFFER_TYPE_WINDOW 0x0 25 #define DRI2_BUFFER_TYPE_PIXMAP 0x1 26 #define DRI2_BUFFER_TYPE_FB 0x2 27 28 typedef union 29 { 30 unsigned int flags; 31 struct 32 { 33 unsigned int type:1; 34 unsigned int is_framebuffer:1; 35 unsigned int is_mapped:1; 36 unsigned int is_reused:1; 37 unsigned int idx_reuse:3; 38 } 39 data; 40 } DRI2BufferFlags; 41 42 typedef struct 43 { 44 unsigned int name; 45 tbm_bo buf_bo; 46 } Buffer; 47 48 typedef struct _Evas_DRI_Image Evas_DRI_Image; 49 typedef struct _DRI_Native DRI_Native; 50 51 struct _Evas_DRI_Image 52 { 53 Display *dis; 54 Visual *visual; 55 int depth; 56 int w, h; 57 int bpl, bpp, rows; 58 unsigned char *data; 59 Drawable draw; 60 tbm_bo buf_bo; 61 DRI2Buffer *buf; 62 void *buf_data; 63 int buf_w, buf_h; 64 Buffer *buf_cache; 65 }; 66 67 struct _DRI_Native 68 { 69 Evas_Native_Surface ns; 70 Pixmap pixmap; 71 Visual *visual; 72 Display *d; 73 74 Evas_DRI_Image *exim; 75 }; 76 77 Evas_DRI_Image *evas_xlib_image_dri_new(int w, int h, Visual *vis, int depth); 78 79 void evas_xlib_image_dir_free(Evas_DRI_Image *exim); 80 Eina_Bool evas_xlib_image_get_buffers(RGBA_Image *im); 81 void evas_xlib_image_buffer_unmap(Evas_DRI_Image *exim); 82 Eina_Bool evas_xlib_image_dri_init(Evas_DRI_Image *exim, Display *display); 83 Eina_Bool evas_xlib_image_dri_used(void); 84 void *evas_xlib_image_dri_native_set(void *data, void *image, void *native); 85