color: generate id for color transformations
Just like with color profiles, generate an ID for color transformations as well. This is not needed by protocol or anything, it is just for debugging purposes. A small ID is easier for humans than a long pointer value. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
parent
b0224c4752
commit
aef9404b1d
@ -1448,6 +1448,7 @@ struct weston_compositor {
|
||||
|
||||
struct weston_color_manager *color_manager;
|
||||
struct weston_idalloc *color_profile_id_generator;
|
||||
struct weston_idalloc *color_transform_id_generator;
|
||||
|
||||
struct weston_renderer *renderer;
|
||||
const struct pixel_format_info *read_format;
|
||||
|
@ -150,6 +150,8 @@ weston_color_transform_unref(struct weston_color_transform *xform)
|
||||
return;
|
||||
|
||||
wl_signal_emit(&xform->destroy_signal, xform);
|
||||
weston_idalloc_put_id(xform->cm->compositor->color_transform_id_generator,
|
||||
xform->id);
|
||||
xform->cm->destroy_color_transform(xform);
|
||||
}
|
||||
|
||||
@ -168,6 +170,7 @@ weston_color_transform_init(struct weston_color_transform *xform,
|
||||
{
|
||||
xform->cm = cm;
|
||||
xform->ref_count = 1;
|
||||
xform->id = weston_idalloc_get_id(cm->compositor->color_transform_id_generator);
|
||||
wl_signal_init(&xform->destroy_signal);
|
||||
}
|
||||
|
||||
|
@ -199,6 +199,7 @@ struct weston_color_mapping {
|
||||
struct weston_color_transform {
|
||||
struct weston_color_manager *cm;
|
||||
int ref_count;
|
||||
uint32_t id; /* For debug */
|
||||
|
||||
/* for renderer or backend to attach their own cached objects */
|
||||
struct wl_signal destroy_signal;
|
||||
|
@ -9247,6 +9247,7 @@ weston_compositor_create(struct wl_display *display,
|
||||
weston_compositor_install_capture_protocol(ec);
|
||||
|
||||
ec->color_profile_id_generator = weston_idalloc_create(ec);
|
||||
ec->color_transform_id_generator = weston_idalloc_create(ec);
|
||||
|
||||
wl_list_init(&ec->view_list);
|
||||
wl_list_init(&ec->plane_list);
|
||||
@ -9775,6 +9776,7 @@ weston_compositor_destroy(struct weston_compositor *compositor)
|
||||
weston_log_scope_destroy(compositor->libseat_debug);
|
||||
compositor->libseat_debug = NULL;
|
||||
|
||||
weston_idalloc_destroy(compositor->color_transform_id_generator);
|
||||
weston_idalloc_destroy(compositor->color_profile_id_generator);
|
||||
|
||||
if (compositor->default_dmabuf_feedback) {
|
||||
|
Loading…
Reference in New Issue
Block a user