From 594fef7dd376afc1f46ef94d73b5df9ac0190d66 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 30 Nov 2017 11:53:53 -0600 Subject: [PATCH] wayland_shm: Wrap function pointers for surface This is going to be an API soon. --- src/modules/evas/engines/wayland_shm/evas_dmabuf.c | 35 ++++++++++++++++++++++ src/modules/evas/engines/wayland_shm/evas_engine.h | 7 +++++ 2 files changed, 42 insertions(+) diff --git a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c index a1d27b9..7a45265 100644 --- a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c +++ b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c @@ -146,6 +146,41 @@ _evas_dmabuf_surface_destroy(Surface *s) free(s); } +void surface_destroy(Surface *surface) +{ + EINA_SAFETY_ON_NULL_RETURN(surface); + + surface->funcs.destroy(surface); +} + +void surface_reconfigure(Surface *surface, int w, int h, uint32_t flags, Eina_Bool force) +{ + EINA_SAFETY_ON_NULL_RETURN(surface); + + surface->funcs.reconfigure(surface, w, h, flags, force); +} + +void *surface_data_get(Surface *surface, int *w, int *h) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL); + + return surface->funcs.data_get(surface, w, h); +} + +int surface_assign(Surface *surface) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(surface, 0); + + return surface->funcs.assign(surface); +} + +void surface_post(Surface *surface, Eina_Rectangle *rects, unsigned int count) +{ + EINA_SAFETY_ON_NULL_RETURN(surface); + + surface->funcs.post(surface, rects, count); +} + Surface * _evas_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha) { diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.h b/src/modules/evas/engines/wayland_shm/evas_engine.h index 6a8379a..0fd318f 100644 --- a/src/modules/evas/engines/wayland_shm/evas_engine.h +++ b/src/modules/evas/engines/wayland_shm/evas_engine.h @@ -139,4 +139,11 @@ void *_evas_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int void _evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h); void _evas_outbuf_redraws_clear(Outbuf *ob); +void surface_destroy(Surface *surface); +void surface_reconfigure(Surface *surface, int w, int h, uint32_t flags, Eina_Bool force); +void *surface_data_get(Surface *surface, int *w, int *h); +int surface_assign(Surface *surface); +void surface_post(Surface *surface, Eina_Rectangle *rects, unsigned int count); + + #endif -- 2.7.4