derekf pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f6ec5b961b4cec2b5784b4ecbd8f33159b786cbc
commit f6ec5b961b4cec2b5784b4ecbd8f33159b786cbc Author: Derek Foreman <[email protected]> Date: Mon Nov 13 15:25:33 2017 -0600 wayland_shm: Move wl_buffer creation function further up file It just looks nicer when it's here and doesn't require a prototype. --- src/modules/evas/engines/wayland_shm/evas_dmabuf.c | 52 +++++++++++----------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c index 0200833c84..68d5b11d41 100644 --- a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c +++ b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c @@ -96,8 +96,6 @@ static void *(*sym_exynos_bo_map)(struct exynos_bo *bo) = NULL; static void (*sym_exynos_bo_destroy)(struct exynos_bo *bo) = NULL; static void (*sym_exynos_device_destroy)(struct exynos_device *) = NULL; -static struct wl_buffer * _evas_dmabuf_wl_buffer_from_dmabuf(Ecore_Wl2_Display *disp, Ecore_Wl2_Buffer *db); - static void buffer_release(void *data, struct wl_buffer *buffer EINA_UNUSED) { @@ -112,6 +110,31 @@ static const struct wl_buffer_listener buffer_listener = buffer_release }; +static struct wl_buffer * +_evas_dmabuf_wl_buffer_from_dmabuf(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer *db) +{ + struct wl_buffer *buf; + struct zwp_linux_dmabuf_v1 *dmabuf; + struct zwp_linux_buffer_params_v1 *dp; + uint32_t flags = 0; + uint32_t format; + + if (db->alpha) + format = DRM_FORMAT_ARGB8888; + else + format = DRM_FORMAT_XRGB8888; + + dmabuf = ecore_wl2_display_dmabuf_get(ewd); + dp = zwp_linux_dmabuf_v1_create_params(dmabuf); + zwp_linux_buffer_params_v1_add(dp, db->fd, 0, 0, db->stride, 0, 0); + buf = zwp_linux_buffer_params_v1_create_immed(dp, db->w, db->h, + format, flags); + wl_buffer_add_listener(buf, &buffer_listener, db); + zwp_linux_buffer_params_v1_destroy(dp); + + return buf; +} + static Buffer_Handle * _intel_alloc(Buffer_Manager *self, const char *name, int w, int h, unsigned long *stride, int32_t *fd) { @@ -667,31 +690,6 @@ _evas_dmabuf_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count) ecore_wl2_window_commit(win, EINA_TRUE); } -static struct wl_buffer * -_evas_dmabuf_wl_buffer_from_dmabuf(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer *db) -{ - struct wl_buffer *buf; - struct zwp_linux_dmabuf_v1 *dmabuf; - struct zwp_linux_buffer_params_v1 *dp; - uint32_t flags = 0; - uint32_t format; - - if (db->alpha) - format = DRM_FORMAT_ARGB8888; - else - format = DRM_FORMAT_XRGB8888; - - dmabuf = ecore_wl2_display_dmabuf_get(ewd); - dp = zwp_linux_dmabuf_v1_create_params(dmabuf); - zwp_linux_buffer_params_v1_add(dp, db->fd, 0, 0, db->stride, 0, 0); - buf = zwp_linux_buffer_params_v1_create_immed(dp, db->w, db->h, - format, flags); - wl_buffer_add_listener(buf, &buffer_listener, db); - zwp_linux_buffer_params_v1_destroy(dp); - - return buf; -} - static Ecore_Wl2_Buffer * ecore_wl2_buffer_create(Ecore_Wl2_Display *ewd, int w, int h, Eina_Bool alpha) { --
