diff --git a/clutter/clutter/clutter-frame-clock.c b/clutter/clutter/clutter-frame-clock.c index 3274df986..8bd1dbe53 100644 --- a/clutter/clutter/clutter-frame-clock.c +++ b/clutter/clutter/clutter-frame-clock.c @@ -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) diff --git a/clutter/clutter/clutter-frame-private.h b/clutter/clutter/clutter-frame-private.h index f2f0a58a4..0b2826be0 100644 --- a/clutter/clutter/clutter-frame-private.h +++ b/clutter/clutter/clutter-frame-private.h @@ -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; }; diff --git a/clutter/clutter/clutter-frame.c b/clutter/clutter/clutter-frame.c index 396287e95..a9033e1e3 100644 --- a/clutter/clutter/clutter-frame.c +++ b/clutter/clutter/clutter-frame.c @@ -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) { diff --git a/clutter/clutter/clutter-frame.h b/clutter/clutter/clutter-frame.h index 716cc219f..48e484467 100644 --- a/clutter/clutter/clutter-frame.h +++ b/clutter/clutter/clutter-frame.h @@ -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);