clutter/stage-cogl: Schedule immediate update on zero refresh interval

Instead of crazy refresh rates >1MHz falling back to 60Hz, just honour
them by rendering unthrottled (same as `sync_delay < 0`). Although I
wouldn't actually expect that path to ever be needed in reality, it just
ensures an infinite `while` loop never happens.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/363
This commit is contained in:
Daniel van Vugt 2018-12-20 15:50:54 +08:00
parent 912a9ecfba
commit ccf27e5f83

View File

@ -203,7 +203,10 @@ clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window,
refresh_interval = (gint64) (0.5 + G_USEC_PER_SEC / refresh_rate);
if (refresh_interval == 0)
refresh_interval = 16667; /* 1/60th second */
{
stage_cogl->update_time = now;
return;
}
min_render_time_allowed = refresh_interval / 2;
max_render_time_allowed = refresh_interval - 1000 * sync_delay;