summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-11-06 13:31:25 -0600
committerDerek Foreman <derekf@osg.samsung.com>2017-11-08 15:12:37 -0600
commitef1279465fb61a01ff39a474c5d0cb47ba9475a3 (patch)
treecbcd1b99dc857d20f79a6414dcaf27811a158042 /src
parent7e1805ada13cf9e851e02ab1cf34b24886db7e4a (diff)
wayland_shm: make creating a wayland buffer back end specific
This way we can have shm and dmabuf share the same framework.
Diffstat (limited to 'src')
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_dmabuf.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
index 0194b62133..5f9de0e7e4 100644
--- a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
+++ b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
@@ -36,6 +36,7 @@ typedef struct _Buffer_Manager Buffer_Manager;
36struct _Buffer_Manager 36struct _Buffer_Manager
37{ 37{
38 Buffer_Handle *(*alloc)(Buffer_Manager *self, const char *name, int w, int h, unsigned long *stride, int32_t *fd); 38 Buffer_Handle *(*alloc)(Buffer_Manager *self, const char *name, int w, int h, unsigned long *stride, int32_t *fd);
39 struct wl_buffer *(*to_buffer)(Ecore_Wl2_Display *ewd, Dmabuf_Buffer *db);
39 void *(*map)(Dmabuf_Buffer *buf); 40 void *(*map)(Dmabuf_Buffer *buf);
40 void (*unmap)(Dmabuf_Buffer *buf); 41 void (*unmap)(Dmabuf_Buffer *buf);
41 void (*discard)(Dmabuf_Buffer *buf); 42 void (*discard)(Dmabuf_Buffer *buf);
@@ -187,6 +188,7 @@ _intel_buffer_manager_setup(int fd)
187 if (!buffer_manager->priv) goto err; 188 if (!buffer_manager->priv) goto err;
188 189
189 buffer_manager->alloc = _intel_alloc; 190 buffer_manager->alloc = _intel_alloc;
191 buffer_manager->to_buffer = _evas_dmabuf_wl_buffer_from_dmabuf;
190 buffer_manager->map = _intel_map; 192 buffer_manager->map = _intel_map;
191 buffer_manager->unmap = _intel_unmap; 193 buffer_manager->unmap = _intel_unmap;
192 buffer_manager->discard = _intel_discard; 194 buffer_manager->discard = _intel_discard;
@@ -292,6 +294,7 @@ _exynos_buffer_manager_setup(int fd)
292 sym_exynos_bo_destroy(bo); 294 sym_exynos_bo_destroy(bo);
293 295
294 buffer_manager->alloc = _exynos_alloc; 296 buffer_manager->alloc = _exynos_alloc;
297 buffer_manager->to_buffer = _evas_dmabuf_wl_buffer_from_dmabuf;
295 buffer_manager->map = _exynos_map; 298 buffer_manager->map = _exynos_map;
296 buffer_manager->unmap = _exynos_unmap; 299 buffer_manager->unmap = _exynos_unmap;
297 buffer_manager->discard = _exynos_discard; 300 buffer_manager->discard = _exynos_discard;
@@ -377,6 +380,12 @@ _buffer_manager_alloc(const char *name, int w, int h, unsigned long *stride, int
377 return out; 380 return out;
378} 381}
379 382
383static struct wl_buffer *
384_buffer_manager_buf_to_wl_buffer(Ecore_Wl2_Display *ewd, Dmabuf_Buffer *buf)
385{
386 return buffer_manager->to_buffer(ewd, buf);
387}
388
380static void * 389static void *
381_buffer_manager_map(Dmabuf_Buffer *buf) 390_buffer_manager_map(Dmabuf_Buffer *buf)
382{ 391{
@@ -686,8 +695,7 @@ _evas_dmabuf_buffer_init(Dmabuf_Surface *s, int w, int h)
686 out->w = w; 695 out->w = w;
687 out->h = h; 696 out->h = h;
688 697
689 out->wl_buffer = _evas_dmabuf_wl_buffer_from_dmabuf(s->surface->ob->ewd, 698 out->wl_buffer = _buffer_manager_buf_to_wl_buffer(s->surface->ob->ewd, out);
690 out);
691 699
692 ecore_wl2_display_flush(s->surface->info->info.wl2_display); 700 ecore_wl2_display_flush(s->surface->info->info.wl2_display);
693 return out; 701 return out;