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
This commit is contained in:
Georges Basile Stavracas Neto 2019-03-27 10:53:46 -03:00
parent f7321d235f
commit 6350efc28e
No known key found for this signature in database
GPG Key ID: 886C17EE170D1385
2 changed files with 10 additions and 0 deletions

View File

@ -134,6 +134,8 @@ void _clutter_stage_presented (ClutterStage *stag
GList * _clutter_stage_peek_stage_views (ClutterStage *stage); GList * _clutter_stage_peek_stage_views (ClutterStage *stage);
int clutter_stage_get_sync_delay (ClutterStage *stage);
G_END_DECLS G_END_DECLS
#endif /* __CLUTTER_STAGE_PRIVATE_H__ */ #endif /* __CLUTTER_STAGE_PRIVATE_H__ */

View File

@ -4722,6 +4722,14 @@ clutter_stage_set_sync_delay (ClutterStage *stage,
stage->priv->sync_delay = sync_delay; 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: * clutter_stage_skip_sync_delay:
* @stage: a #ClutterStage * @stage: a #ClutterStage