libweston: Use weston_log_paced for unmapped surface or view warning

Copy the existing behaviour with the new paced logging mechanism.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2022-11-04 09:51:55 -05:00
parent 6428fd13b7
commit 771bd8acff
2 changed files with 5 additions and 9 deletions

View file

@ -1326,10 +1326,7 @@ struct weston_compositor {
struct content_protection *content_protection;
/* One-time warning about a view appearing in the layer list when it
* or its surface are not mapped. */
bool warned_about_unmapped_surface_or_view;
struct weston_log_pacer unmapped_surface_or_view_pacer;
struct weston_log_pacer presentation_clock_failure_pacer;
};

View file

@ -2877,11 +2877,10 @@ view_list_add(struct weston_compositor *compositor,
if (!weston_surface_is_mapped(view->surface) ||
!weston_view_is_mapped(view) ||
!weston_surface_has_content(view->surface)) {
if (!compositor->warned_about_unmapped_surface_or_view) {
weston_log("Detected an unmapped surface or view in "
"the layer list, which should not occur.\n");
compositor->warned_about_unmapped_surface_or_view = true;
}
weston_log_paced(&compositor->unmapped_surface_or_view_pacer,
1, 0,
"Detected an unmapped surface or view in "
"the layer list, which should not occur.\n");
pnode = weston_view_find_paint_node(view, output);
if (pnode)