1
0
Fork 0

clutter/frame-clock: Log N-buffers in CLUTTTER_DEBUG=frame-timings

Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
Daniel van Vugt 2021-12-10 16:28:04 +08:00 committed by Mingi Sung
parent 0b2e48db6f
commit a1e6d2242b
Signed by: sungmg
GPG key ID: 41BAFD6FFD8036C5

View file

@ -283,6 +283,12 @@ void
clutter_frame_clock_notify_presented (ClutterFrameClock *frame_clock, clutter_frame_clock_notify_presented (ClutterFrameClock *frame_clock,
ClutterFrameInfo *frame_info) ClutterFrameInfo *frame_info)
{ {
#ifdef CLUTTER_ENABLE_DEBUG
const char *debug_state =
frame_clock->state == CLUTTER_FRAME_CLOCK_STATE_DISPATCHED_TWO ?
"Triple buffering" : "Double buffering";
#endif
COGL_TRACE_BEGIN_SCOPED (ClutterFrameClockNotifyPresented, COGL_TRACE_BEGIN_SCOPED (ClutterFrameClockNotifyPresented,
"Clutter::FrameClock::presented()"); "Clutter::FrameClock::presented()");
COGL_TRACE_DESCRIBE (ClutterFrameClockNotifyPresented, COGL_TRACE_DESCRIBE (ClutterFrameClockNotifyPresented,
@ -408,7 +414,8 @@ clutter_frame_clock_notify_presented (ClutterFrameClock *frame_clock,
frame_info->cpu_time_before_buffer_swap_us; frame_info->cpu_time_before_buffer_swap_us;
CLUTTER_NOTE (FRAME_TIMINGS, CLUTTER_NOTE (FRAME_TIMINGS,
"update2dispatch %ld µs, dispatch2swap %ld µs, swap2render %ld µs, swap2flip %ld µs", "%s: update2dispatch %ld µs, dispatch2swap %ld µs, swap2render %ld µs, swap2flip %ld µs",
debug_state,
frame_clock->last_dispatch_lateness_us, frame_clock->last_dispatch_lateness_us,
dispatch_to_swap_us, dispatch_to_swap_us,
swap_to_rendering_done_us, swap_to_rendering_done_us,
@ -428,7 +435,8 @@ clutter_frame_clock_notify_presented (ClutterFrameClock *frame_clock,
} }
else else
{ {
CLUTTER_NOTE (FRAME_TIMINGS, "update2dispatch %ld µs", CLUTTER_NOTE (FRAME_TIMINGS, "%s: update2dispatch %ld µs",
debug_state,
frame_clock->last_dispatch_lateness_us); frame_clock->last_dispatch_lateness_us);
} }