libweston: Notify timeline of object modification

We notify the timeline of the fact that the object suffered
modifications through the 'set_label' function. Remove the old
refresh variable.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
dev
Marius Vlad 5 years ago
parent 3203ff68ad
commit 5de9297df2
  1. 4
      include/libweston/libweston.h
  2. 8
      include/libweston/timeline-object.h
  3. 3
      libweston/compositor.c
  4. 28
      libweston/timeline.c

@ -2049,6 +2049,10 @@ weston_log_ctx_compositor_destroy(struct weston_compositor *compositor);
int
weston_compositor_enable_content_protection(struct weston_compositor *compositor);
void
weston_timeline_refresh_subscription_objects(struct weston_compositor *wc,
void *object);
#ifdef __cplusplus
}
#endif

@ -42,14 +42,6 @@ struct weston_timeline_object {
/* Object id in the timeline JSON output. 0 is invalid. */
unsigned id;
/*
* If non-zero, forces a re-emission of object description.
* Should be set to non-zero, when changing long-lived
* object state that is not emitted on normal timeline
* events.
*/
unsigned force_refresh;
};
#endif /* WESTON_TIMELINE_OBJECT_H */

@ -4088,7 +4088,8 @@ weston_surface_set_label_func(struct weston_surface *surface,
char *, size_t))
{
surface->get_label = desc;
surface->timeline.force_refresh = 1;
weston_timeline_refresh_subscription_objects(surface->compositor,
surface);
}
/** Get the size of surface contents

@ -308,6 +308,34 @@ emit_gpu_timestamp(struct timeline_emit_context *ctx, void *obj)
return 1;
}
static struct weston_timeline_subscription_object *
weston_timeline_get_subscription_object(struct weston_log_subscription *sub,
void *object)
{
struct weston_timeline_subscription *tl_sub;
tl_sub = weston_log_subscription_get_data(sub);
if (!tl_sub)
return NULL;
return weston_timeline_subscription_search(tl_sub, object);
}
WL_EXPORT void
weston_timeline_refresh_subscription_objects(struct weston_compositor *wc,
void *object)
{
struct weston_log_subscription *sub = NULL;
while ((sub = weston_log_subscription_iterate(wc->timeline, sub))) {
struct weston_timeline_subscription_object *sub_obj;
sub_obj = weston_timeline_get_subscription_object(sub, object);
if (sub_obj)
sub_obj->force_refresh = true;
}
}
typedef int (*type_func)(struct timeline_emit_context *ctx, void *obj);
static const type_func type_dispatch[] = {

Loading…
Cancel
Save