src/bin/e_hwc_window_queue.h \
src/bin/e_explicit_sync.h \
src/bin/e_egl_sync.h \
-src/bin/e_info_server_input.h
-
-if HAVE_WAYLAND_TBM
-ENLIGHTENMENTHEADERS += \
-src/bin/e_comp_wl_tbm.h
-endif
-
-ENLIGHTENMENTHEADERS += \
+src/bin/e_info_server_input.h \
+src/bin/e_comp_wl_tbm.h \
src/bin/e_comp_wl_renderer.h \
src/bin/e_comp_wl_tizen_hwc.h \
src/bin/e_presentation_time.h \
src/bin/e_explicit_sync.c \
src/bin/e_egl_sync.c \
src/bin/e_info_server_input.c \
-$(ENLIGHTENMENTHEADERS)
-
-if HAVE_WAYLAND_TBM
-enlightenment_src += \
-src/bin/e_comp_wl_tbm.c
-endif
-
-enlightenment_src += \
+src/bin/e_comp_wl_tbm.c \
src/bin/e_comp_wl_renderer.c \
src/bin/e_comp_wl_tizen_hwc.c \
src/bin/e_presentation_time.c \
#include <tbm_bufmgr.h>
#include <tbm_surface_internal.h>
+static E_Comp_Wl_Tbm_Funcs *_e_comp_wl_tbm_funcs = NULL;
+
static int
_e_comp_wl_tbm_bind_wl_display(struct wayland_tbm_server *tbm_server, struct wl_display *display)
{
return EINA_TRUE;
}
+E_API Eina_Bool
+e_comp_wl_tbm_module_func_set(const char *module_name, E_Comp_Wl_Tbm_Funcs *fn)
+{
+ EINA_SAFETY_ON_FALSE_RETURN_VAL((_e_comp_wl_tbm_funcs == NULL), EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(fn, EINA_FALSE);
+
+ _e_comp_wl_tbm_funcs = E_NEW(E_Comp_Wl_Tbm_Funcs, 1);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_e_comp_wl_tbm_funcs, EINA_FALSE);
+
+ _e_comp_wl_tbm_funcs->module_name = strdup(module_name);
+ _e_comp_wl_tbm_funcs->capturable_buffer_get = fn->capturable_buffer_get;
+
+ return EINA_TRUE;
+}
+
+E_API Eina_Bool
+e_comp_wl_tbm_module_func_unset(void)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_e_comp_wl_tbm_funcs, EINA_FALSE);
+
+ if (_e_comp_wl_tbm_funcs->module_name)
+ free(_e_comp_wl_tbm_funcs->module_name);
+
+ E_FREE(_e_comp_wl_tbm_funcs);
+ _e_comp_wl_tbm_funcs = NULL;
+
+ return EINA_TRUE;
+}
+
+EINTERN tbm_surface_h
+e_comp_wl_tbm_capturable_buffer_get(tbm_surface_h tsurface)
+{
+ tbm_surface_h capturable_buffer = NULL;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(tsurface, NULL);
+
+ if (_e_comp_wl_tbm_funcs && _e_comp_wl_tbm_funcs->capturable_buffer_get)
+ {
+ if (_e_comp_wl_tbm_funcs->capturable_buffer_get(tsurface, &capturable_buffer))
+ return capturable_buffer;
+ }
+
+ tbm_surface_internal_ref(tsurface);
+
+ return tsurface;
+}
+
EINTERN Eina_Bool
e_comp_wl_tbm_init(void)
{
#ifdef E_TYPEDEFS
+typedef struct _E_Comp_Wl_Tbm_Funcs E_Comp_Wl_Tbm_Funcs;
+
#else
# ifndef E_COMP_WL_TBM_H
# define E_COMP_WL_TBM_H
#include <tbm_surface.h>
+struct _E_Comp_Wl_Tbm_Funcs
+{
+ char *module_name;
+
+ /* reference count of dst_tsurface should be increased */
+ Eina_Bool (*capturable_buffer_get)(tbm_surface_h src_tsurface, tbm_surface_h *dst_tsurface);
+};
+
EINTERN Eina_Bool e_comp_wl_tbm_init(void);
EINTERN void e_comp_wl_tbm_shutdown(void);
EINTERN struct wl_resource *e_comp_wl_tbm_remote_buffer_get(struct wl_resource *wl_tbm, struct wl_resource *wl_buffer);
EINTERN struct wl_resource *e_comp_wl_tbm_remote_buffer_get_with_tbm(struct wl_resource *wl_tbm, tbm_surface_h tbm_surface);
+
+E_API Eina_Bool e_comp_wl_tbm_module_func_set(const char *module_name, E_Comp_Wl_Tbm_Funcs *fn);
+E_API Eina_Bool e_comp_wl_tbm_module_func_unset(void);
+
+/* reference count of returned tbm_surface should be decreased when not using it anymore */
+EINTERN tbm_surface_h e_comp_wl_tbm_capturable_buffer_get(tbm_surface_h tsurface);
# endif
#endif
#include "e_comp_wl_data.h"
#include "e_comp_wl_input.h"
#include "e_uuid_store.h"
-#ifdef HAVE_WAYLAND_TBM
-# include "e_comp_wl_tbm.h"
-#endif
+#include "e_comp_wl_tbm.h"
#include "e_comp_wl_rsm.h"
#include "e_comp_wl_screenshooter.h"
#include "e_comp_wl_viewport.h"