summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/wayland_shm/evas_shm.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-04-08 15:04:33 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-04-19 15:11:09 -0400
commit78688b226f2683f1c7438962ec419642c09e4d43 (patch)
treec3f8e5d51d0652253f038193ca72d27b3c945588 /src/modules/evas/engines/wayland_shm/evas_shm.c
parent7e2f5e759e2eaf00f3850b84aa39384b3d0acc42 (diff)
wayland_shm: Move Shm private structures into evas_shm
Refactor all the shm specific stuff into evas_shm so it can better co-exist with upcoming dmabuf allocations
Diffstat (limited to 'src/modules/evas/engines/wayland_shm/evas_shm.c')
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_shm.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c b/src/modules/evas/engines/wayland_shm/evas_shm.c
index 9a2f5bb5f4..69e776fd1e 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -31,6 +31,50 @@
31#include "evas_engine.h" 31#include "evas_engine.h"
32#include <sys/mman.h> 32#include <sys/mman.h>
33 33
34typedef struct _Shm_Pool Shm_Pool;
35struct _Shm_Pool
36{
37 struct wl_shm_pool *pool;
38 size_t size, used;
39 void *data;
40};
41
42typedef struct _Shm_Data Shm_Data;
43struct _Shm_Data
44{
45 struct wl_buffer *buffer;
46 Shm_Pool *pool;
47 void *map;
48};
49
50typedef struct _Shm_Leaf Shm_Leaf;
51struct _Shm_Leaf
52{
53 int w, h, busy, age;
54 Shm_Data *data;
55 Shm_Pool *resize_pool;
56 Eina_Bool valid : 1;
57 Eina_Bool reconfigure : 1;
58 Eina_Bool drawn : 1;
59};
60
61typedef struct _Shm_Surface Shm_Surface;
62struct _Shm_Surface
63{
64 struct wl_display *disp;
65 struct wl_shm *shm;
66 struct wl_surface *surface;
67 int w, h;
68 int dx, dy;
69 int num_buff;
70 int compositor_version;
71
72 Shm_Leaf leaf[MAX_BUFFERS];
73 Shm_Leaf *current;
74
75 Eina_Bool alpha : 1;
76};
77
34static Eina_Bool _shm_leaf_create(Shm_Surface *surface, Shm_Leaf *leaf, int w, int h); 78static Eina_Bool _shm_leaf_create(Shm_Surface *surface, Shm_Leaf *leaf, int w, int h);
35static void _shm_leaf_release(Shm_Leaf *leaf); 79static void _shm_leaf_release(Shm_Leaf *leaf);
36static void _shm_leaf_destroy(Shm_Leaf *leaf); 80static void _shm_leaf_destroy(Shm_Leaf *leaf);