mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
clutter: Record flip time
Will be used for intelligent max render time computation (aka repaint scheduling). Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1762>
This commit is contained in:
parent
9f492a0ee0
commit
63b9ac2724
@ -76,6 +76,9 @@ struct _ClutterFrameClock
|
||||
gboolean is_next_presentation_time_valid;
|
||||
int64_t next_presentation_time_us;
|
||||
|
||||
/* Last KMS buffer submission time. */
|
||||
int64_t last_flip_time_us;
|
||||
|
||||
gboolean pending_reschedule;
|
||||
gboolean pending_reschedule_now;
|
||||
|
||||
@ -548,6 +551,13 @@ frame_clock_source_dispatch (GSource *source,
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_frame_clock_record_flip_time (ClutterFrameClock *frame_clock,
|
||||
int64_t flip_time_us)
|
||||
{
|
||||
frame_clock->last_flip_time_us = flip_time_us;
|
||||
}
|
||||
|
||||
static GSourceFuncs frame_clock_source_funcs = {
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -90,4 +90,7 @@ 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);
|
||||
|
||||
#endif /* CLUTTER_FRAME_CLOCK_H */
|
||||
|
@ -1187,6 +1187,9 @@ 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_stage_emit_after_paint (stage, view);
|
||||
|
||||
if (_clutter_context_get_show_fps ())
|
||||
|
Loading…
Reference in New Issue
Block a user