clutte/stage-view: Add refresh rate getter

Will be used to find the view with the most appropriate refresh rate
(e.g. the fastest).

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
This commit is contained in:
Jonas Ådahl 2020-05-22 22:59:57 +02:00
parent 2e358f3c43
commit 3aff755048
2 changed files with 11 additions and 0 deletions

View File

@ -63,6 +63,8 @@ void clutter_stage_view_transform_rect_to_onscreen (ClutterStageView
int dst_height,
cairo_rectangle_int_t *dst_rect);
float clutter_stage_view_get_refresh_rate (ClutterStageView *view);
ClutterFrameClock * clutter_stage_view_get_frame_clock (ClutterStageView *view);
#endif /* __CLUTTER_STAGE_VIEW_PRIVATE_H__ */

View File

@ -1001,6 +1001,15 @@ clutter_stage_view_take_scanout (ClutterStageView *view)
return g_steal_pointer (&priv->next_scanout);
}
float
clutter_stage_view_get_refresh_rate (ClutterStageView *view)
{
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
return priv->refresh_rate;
}
ClutterFrameClock *
clutter_stage_view_get_frame_clock (ClutterStageView *view)
{