mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-07 13:08:04 +02:00
fontend: Arm the surface counter timer only when using debug
Rather than having this timer always fire up & running, do it when we actually enable debug, with the `--debug` cmd line argument. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
parent
bbe0b74ebd
commit
5f1c43de29
3 changed files with 20 additions and 0 deletions
|
|
@ -4683,6 +4683,8 @@ wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_data)
|
|||
weston_compositor_add_screenshot_authority(wet.compositor,
|
||||
&wet.screenshot_auth,
|
||||
screenshot_allow_all);
|
||||
|
||||
weston_compositor_arm_surface_counter_fps(wet.compositor);
|
||||
}
|
||||
|
||||
if (flight_rec)
|
||||
|
|
|
|||
|
|
@ -2896,6 +2896,12 @@ weston_output_set_vrr_mode(struct weston_output *output,
|
|||
uint32_t
|
||||
weston_output_get_supported_vrr_modes(struct weston_output *output);
|
||||
|
||||
void
|
||||
weston_compositor_arm_surface_counter_fps(struct weston_compositor *ec);
|
||||
|
||||
void
|
||||
weston_compositor_disarm_surface_counter_fps(struct weston_compositor *ec);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -9718,11 +9718,23 @@ weston_compositor_create_surface_counter_fps(struct weston_compositor *ec, uint3
|
|||
|
||||
ec->perf_surface_stats.frame_counter_timer =
|
||||
wl_event_loop_add_timer(loop, surface_statistics_timer_handler, ec);
|
||||
}
|
||||
|
||||
WL_EXPORT void
|
||||
weston_compositor_arm_surface_counter_fps(struct weston_compositor *ec)
|
||||
{
|
||||
assert(ec->perf_surface_stats.frame_counter_timer);
|
||||
wl_event_source_timer_update(ec->perf_surface_stats.frame_counter_timer,
|
||||
1000 * ec->perf_surface_stats.frame_counter_interval);
|
||||
}
|
||||
|
||||
WL_EXPORT void
|
||||
weston_compositor_disarm_surface_counter_fps(struct weston_compositor *ec)
|
||||
{
|
||||
assert(ec->perf_surface_stats.frame_counter_timer);
|
||||
wl_event_source_timer_update(ec->perf_surface_stats.frame_counter_timer, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the 'scene-graph' debug scope is bound by a client. This
|
||||
* one-shot weston-debug scope prints the current scene graph when bound,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue