From 6350efc28ee21b2a3fd4c6669bcf50a85f24926b Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 27 Mar 2019 10:53:46 -0300 Subject: [PATCH] clutter/stage: Add private getter to sync delay It will be used by the frame chart to correctly place the red bar. The math is essentially: ms_per_frame = (1 / refresh rate) * 1000 - sync delay https://gitlab.gnome.org/GNOME/mutter/merge_requests/502 --- clutter/clutter/clutter-stage-private.h | 2 ++ clutter/clutter/clutter-stage.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/clutter/clutter/clutter-stage-private.h b/clutter/clutter/clutter-stage-private.h index 4799c29e1..cb887ea32 100644 --- a/clutter/clutter/clutter-stage-private.h +++ b/clutter/clutter/clutter-stage-private.h @@ -134,6 +134,8 @@ void _clutter_stage_presented (ClutterStage *stag GList * _clutter_stage_peek_stage_views (ClutterStage *stage); +int clutter_stage_get_sync_delay (ClutterStage *stage); + G_END_DECLS #endif /* __CLUTTER_STAGE_PRIVATE_H__ */ diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index 25ce9d899..1cb5cb9b6 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -4722,6 +4722,14 @@ clutter_stage_set_sync_delay (ClutterStage *stage, stage->priv->sync_delay = sync_delay; } +int +clutter_stage_get_sync_delay (ClutterStage *stage) +{ + g_return_val_if_fail (CLUTTER_IS_STAGE (stage), -1); + + return stage->priv->sync_delay; +} + /** * clutter_stage_skip_sync_delay: * @stage: a #ClutterStage