1
0
Fork 0

clutter: Pass ClutterFrameHint(s) to the frame clock

Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
Daniel van Vugt 2021-09-07 19:15:18 +08:00 committed by Mingi Sung
parent f366a7d931
commit 6523517350
Signed by: sungmg
GPG key ID: 41BAFD6FFD8036C5
3 changed files with 18 additions and 6 deletions

View file

@ -118,6 +118,8 @@ struct _ClutterFrameClock
int64_t last_flip_time_us;
int64_t prev_last_flip_time_us;
ClutterFrameHint last_flip_hints;
/* Last time we promoted short-term maximum to long-term one */
int64_t longterm_promotion_us;
/* Long-term maximum update duration */
@ -1176,11 +1178,13 @@ frame_clock_source_dispatch (GSource *source,
}
void
clutter_frame_clock_record_flip_time (ClutterFrameClock *frame_clock,
int64_t flip_time_us)
clutter_frame_clock_record_flip (ClutterFrameClock *frame_clock,
int64_t flip_time_us,
ClutterFrameHint hints)
{
frame_clock->prev_last_flip_time_us = frame_clock->last_flip_time_us;
frame_clock->last_flip_time_us = flip_time_us;
frame_clock->last_flip_hints = hints;
}
GString *

View file

@ -108,8 +108,9 @@ void clutter_frame_clock_remove_timeline (ClutterFrameClock *frame_clock,
CLUTTER_EXPORT
float clutter_frame_clock_get_refresh_rate (ClutterFrameClock *frame_clock);
void clutter_frame_clock_record_flip_time (ClutterFrameClock *frame_clock,
int64_t flip_time_us);
void clutter_frame_clock_record_flip (ClutterFrameClock *frame_clock,
int64_t flip_time_us,
ClutterFrameHint hints);
GString * clutter_frame_clock_get_max_render_time_debug_info (ClutterFrameClock *frame_clock);

View file

@ -1075,14 +1075,21 @@ handle_frame_clock_frame (ClutterFrameClock *frame_clock,
_clutter_stage_window_redraw_view (stage_window, view, frame);
clutter_frame_clock_record_flip_time (frame_clock,
g_get_monotonic_time ());
clutter_frame_clock_record_flip (frame_clock,
g_get_monotonic_time (),
clutter_frame_get_hints (frame));
clutter_stage_emit_after_paint (stage, view, frame);
if (clutter_context_get_show_fps (context))
end_frame_timing_measurement (view);
}
else
{
clutter_frame_clock_record_flip (frame_clock,
g_get_monotonic_time (),
clutter_frame_get_hints (frame));
}
_clutter_stage_window_finish_frame (stage_window, view, frame);