diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2019-03-17 18:10:09 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-06-19 07:44:51 +0000 |
commit | 1bbdafd2a7fe053756f7121c2e807885c8162c3f (patch) | |
tree | 1fa5b1c44eaf33a810a653f515b5561f9091a95f | |
parent | 384210be5a17d63a3673ec8cc943465dacc42b36 (diff) | |
download | weston-1bbdafd2a7fe053756f7121c2e807885c8162c3f.tar.gz |
compositor: Fix invalid view numbering in scene-graph
With the addition of patch 433f4e77b7729 we display the same view id (0)
for every view as we're modifying the local variable.
Displaying sub-surfaces based views is also problematic. The caller need
to modify the view number as well, so we instead we pass the address as
to allow that to happen. Otherwise we end up repeating the same number
for views without sub-subrfaces once those have been printed.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
(cherry picked from commit a6acfa83460d4f1e9f59fd5e52a8e39e1b8d4167)
-rw-r--r-- | libweston/compositor.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libweston/compositor.c b/libweston/compositor.c index d87522e7..4c096ae3 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -6647,7 +6647,7 @@ debug_scene_view_print(FILE *fp, struct weston_view *view, int view_idx) static void debug_scene_view_print_tree(struct weston_view *view, - FILE *fp, int view_idx) + FILE *fp, int *view_idx) { struct weston_subsurface *sub; struct weston_view *ev; @@ -6656,7 +6656,7 @@ debug_scene_view_print_tree(struct weston_view *view, * print the view first, then we recursively go on printing * sub-surfaces. We bail out once no more sub-surfaces are available. */ - debug_scene_view_print(fp, view, view_idx++); + debug_scene_view_print(fp, view, *view_idx); /* no more sub-surfaces */ if (wl_list_empty(&view->surface->subsurface_list)) @@ -6667,6 +6667,8 @@ debug_scene_view_print_tree(struct weston_view *view, /* do not print again the parent view */ if (view == ev) continue; + + (*view_idx)++; debug_scene_view_print_tree(ev, fp, view_idx); } } @@ -6741,8 +6743,10 @@ weston_compositor_print_scene_graph(struct weston_compositor *ec) layer->mask.x2, layer->mask.y2); } - wl_list_for_each(view, &layer->view_list.link, layer_link.link) - debug_scene_view_print_tree(view, fp, view_idx); + wl_list_for_each(view, &layer->view_list.link, layer_link.link) { + debug_scene_view_print_tree(view, fp, &view_idx); + view_idx++; + } if (wl_list_empty(&layer->view_list.link)) fprintf(fp, "\t[no views]\n"); |