compositor: Fix invalid view numbering in scene-graph

With the addition of patch 433f4e77b7 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>
dev
Marius Vlad 6 years ago committed by Daniel Stone
parent 66581d245e
commit a6acfa8346
  1. 12
      libweston/compositor.c

@ -6647,7 +6647,7 @@ debug_scene_view_print(FILE *fp, struct weston_view *view, int view_idx)
static void static void
debug_scene_view_print_tree(struct weston_view *view, 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_subsurface *sub;
struct weston_view *ev; 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 * print the view first, then we recursively go on printing
* sub-surfaces. We bail out once no more sub-surfaces are available. * 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 */ /* no more sub-surfaces */
if (wl_list_empty(&view->surface->subsurface_list)) 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 */ /* do not print again the parent view */
if (view == ev) if (view == ev)
continue; continue;
(*view_idx)++;
debug_scene_view_print_tree(ev, fp, 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); layer->mask.x2, layer->mask.y2);
} }
wl_list_for_each(view, &layer->view_list.link, layer_link.link) wl_list_for_each(view, &layer->view_list.link, layer_link.link) {
debug_scene_view_print_tree(view, fp, view_idx); debug_scene_view_print_tree(view, fp, &view_idx);
view_idx++;
}
if (wl_list_empty(&layer->view_list.link)) if (wl_list_empty(&layer->view_list.link))
fprintf(fp, "\t[no views]\n"); fprintf(fp, "\t[no views]\n");

Loading…
Cancel
Save