mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 20:32:16 +00:00
tests/clutter/frame-clock*: Use clutter_frame_get_target_presentation_time
Instead of g_get_monotonic_time. This makes sure last_presentation_time_us advances by refresh_interval_us. Doesn't affect test results at this point, but it will with the next commit. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3174>
This commit is contained in:
parent
9f8283a95a
commit
effc985401
@ -12,11 +12,15 @@ timeline_frame_clock_frame (ClutterFrameClock *frame_clock,
|
||||
ClutterFrameInfo frame_info;
|
||||
|
||||
frame_info = (ClutterFrameInfo) {
|
||||
.presentation_time = g_get_monotonic_time (),
|
||||
.refresh_rate = refresh_rate,
|
||||
.flags = CLUTTER_FRAME_INFO_FLAG_NONE,
|
||||
.sequence = 0,
|
||||
};
|
||||
|
||||
if (!clutter_frame_get_target_presentation_time (frame,
|
||||
&frame_info.presentation_time))
|
||||
frame_info.presentation_time = g_get_monotonic_time ();
|
||||
|
||||
clutter_frame_clock_notify_presented (frame_clock, &frame_info);
|
||||
clutter_frame_clock_schedule_update (frame_clock);
|
||||
|
||||
|
@ -190,6 +190,7 @@ immediate_frame_clock_frame (ClutterFrameClock *frame_clock,
|
||||
gpointer user_data)
|
||||
{
|
||||
GMainLoop *main_loop = user_data;
|
||||
int64_t target_presentation_time_us;
|
||||
ClutterFrameInfo frame_info;
|
||||
|
||||
g_assert_cmpint (clutter_frame_get_count (frame), ==, expected_frame_count);
|
||||
@ -204,7 +205,11 @@ immediate_frame_clock_frame (ClutterFrameClock *frame_clock,
|
||||
|
||||
test_frame_count--;
|
||||
|
||||
init_frame_info (&frame_info, g_get_monotonic_time ());
|
||||
if (!clutter_frame_get_target_presentation_time (frame,
|
||||
&target_presentation_time_us))
|
||||
target_presentation_time_us = g_get_monotonic_time ();
|
||||
|
||||
init_frame_info (&frame_info, target_presentation_time_us);
|
||||
clutter_frame_clock_notify_presented (frame_clock, &frame_info);
|
||||
g_idle_add (schedule_update_idle, frame_clock);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user