clutter/frame: Carry target presentation time
This will be used, when available, to both check whether frames missed a vsync cycle, or to calculate when page flips should be queued. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2795>
This commit is contained in:
parent
916b21674e
commit
56da8418f9
@ -733,6 +733,8 @@ clutter_frame_clock_dispatch (ClutterFrameClock *frame_clock,
|
||||
|
||||
frame = g_new0 (ClutterFrame, 1);
|
||||
frame->frame_count = frame_count;
|
||||
frame->has_target_presentation_time = frame_clock->is_next_presentation_time_valid;
|
||||
frame->target_presentation_time_us = frame_clock->next_presentation_time_us;
|
||||
|
||||
COGL_TRACE_BEGIN (ClutterFrameClockEvents, "Frame Clock (before frame)");
|
||||
if (iface->before_frame)
|
||||
|
@ -24,6 +24,9 @@ struct _ClutterFrame
|
||||
{
|
||||
int64_t frame_count;
|
||||
|
||||
gboolean has_target_presentation_time;
|
||||
int64_t target_presentation_time_us;
|
||||
|
||||
gboolean has_result;
|
||||
ClutterFrameResult result;
|
||||
};
|
||||
|
@ -23,6 +23,21 @@ clutter_frame_get_count (ClutterFrame *frame)
|
||||
return frame->frame_count;
|
||||
}
|
||||
|
||||
gboolean
|
||||
clutter_frame_get_target_presentation_time (ClutterFrame *frame,
|
||||
int64_t *target_presentation_time_us)
|
||||
{
|
||||
if (frame->has_target_presentation_time)
|
||||
{
|
||||
*target_presentation_time_us = frame->target_presentation_time_us;
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
ClutterFrameResult
|
||||
clutter_frame_get_result (ClutterFrame *frame)
|
||||
{
|
||||
|
@ -29,6 +29,10 @@ typedef struct _ClutterFrame ClutterFrame;
|
||||
CLUTTER_EXPORT
|
||||
int64_t clutter_frame_get_count (ClutterFrame *frame);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_frame_get_target_presentation_time (ClutterFrame *frame,
|
||||
int64_t *target_presentation_time_us);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_frame_set_result (ClutterFrame *frame,
|
||||
ClutterFrameResult result);
|
||||
|
Loading…
Reference in New Issue
Block a user