};
struct _tpl_wayland_egl_surface {
+ tpl_object_t base;
twe_surface_h twe_surface;
tbm_surface_queue_h tbm_queue;
tpl_bool_t is_activated;
surface->backend.data = (void *)wayland_egl_surface;
+ if (__tpl_object_init(&wayland_egl_surface->base,
+ TPL_OBJECT_SURFACE,
+ NULL) != TPL_ERROR_NONE) {
+ TPL_ERR("Failed to initialize backend surface's base object!");
+ goto object_init_fail;
+ }
+
twe_surface = twe_surface_add(wayland_egl_display->wl_egl_thread,
wayland_egl_display->twe_display,
surface->native_handle,
queue_create_fail:
twe_surface_del(twe_surface);
create_twe_surface_fail:
+object_init_fail:
free(wayland_egl_surface);
surface->backend.data = NULL;
return TPL_ERROR_INVALID_OPERATION;
wayland_egl_surface = (tpl_wayland_egl_surface_t *) surface->backend.data;
TPL_CHECK_ON_NULL_RETURN(wayland_egl_surface);
+ TPL_OBJECT_LOCK(wayland_egl_surface);
+
wayland_egl_display = (tpl_wayland_egl_display_t *)
surface->display->backend.data;
TPL_CHECK_ON_NULL_RETURN(wayland_egl_display);
wayland_egl_surface->tbm_queue = NULL;
}
+ TPL_OBJECT_UNLOCK(wayland_egl_surface);
+ __tpl_object_fini(&wayland_egl_surface->base);
free(wayland_egl_surface);
surface->backend.data = NULL;
}
tpl_result_t ret = TPL_ERROR_NONE;
int bo_name = 0;
+ TPL_OBJECT_LOCK(wayland_egl_surface);
+
bo_name = tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0));
if (!wayland_egl_surface) {
TPL_ERR("Invalid parameter. wayland_egl_surface(%p)",
wayland_egl_surface);
TRACE_ASYNC_END((int)tbm_surface, "[DEQ]~[ENQ] BO_NAME:%d", bo_name);
+ TPL_OBJECT_UNLOCK(wayland_egl_surface);
return TPL_ERROR_INVALID_PARAMETER;
}
TPL_ERR("Failed to enqueue tbm_surface(%p) Invalid value.",
tbm_surface);
TRACE_ASYNC_END((int)tbm_surface, "[DEQ]~[ENQ] BO_NAME:%d", bo_name);
+ TPL_OBJECT_UNLOCK(wayland_egl_surface);
return TPL_ERROR_INVALID_PARAMETER;
}
}
TRACE_ASYNC_END((int)tbm_surface, "[DEQ]~[ENQ] BO_NAME:%d", bo_name);
-
+ TPL_OBJECT_UNLOCK(wayland_egl_surface);
return TPL_ERROR_NONE;
}
TPL_ERR("Failed to enqueue tbm_surface(%p). tsq_err=%d",
tbm_surface, tsq_err);
TRACE_ASYNC_END((int)tbm_surface, "[DEQ]~[ENQ] BO_NAME:%d", bo_name);
+ TPL_OBJECT_UNLOCK(wayland_egl_surface);
return TPL_ERROR_INVALID_OPERATION;
}
TRACE_ASYNC_END((int)tbm_surface, "[DEQ]~[ENQ] BO_NAME:%d", bo_name);
+ TPL_OBJECT_UNLOCK(wayland_egl_surface);
return TPL_ERROR_NONE;
}