diff --git a/clutter/clutter/cogl/clutter-stage-cogl.c b/clutter/clutter/cogl/clutter-stage-cogl.c index 1f69b3092..229015b90 100644 --- a/clutter/clutter/cogl/clutter-stage-cogl.c +++ b/clutter/clutter/cogl/clutter-stage-cogl.c @@ -185,18 +185,6 @@ clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window, return; } - /* We only extrapolate presentation times for 150ms - this is somewhat - * arbitrary. The reasons it might not be accurate for larger times are - * that the refresh interval might be wrong or the vertical refresh - * might be downclocked if nothing is going on onscreen. - */ - if (stage_cogl->last_presentation_time == 0|| - stage_cogl->last_presentation_time < now - 150000) - { - stage_cogl->update_time = now; - return; - } - refresh_rate = stage_cogl->refresh_rate; if (refresh_rate <= 0.0) refresh_rate = clutter_get_default_frame_rate (); @@ -220,6 +208,9 @@ clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window, next_presentation_time += refresh_interval; stage_cogl->update_time = next_presentation_time - max_render_time_allowed; + + if (stage_cogl->update_time == stage_cogl->last_update_time) + stage_cogl->update_time = stage_cogl->last_update_time + refresh_interval; } static gint64 @@ -238,6 +229,7 @@ clutter_stage_cogl_clear_update_time (ClutterStageWindow *stage_window) { ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window); + stage_cogl->last_update_time = stage_cogl->update_time; stage_cogl->update_time = -1; } diff --git a/clutter/clutter/cogl/clutter-stage-cogl.h b/clutter/clutter/cogl/clutter-stage-cogl.h index aead9785e..a69c424eb 100644 --- a/clutter/clutter/cogl/clutter-stage-cogl.h +++ b/clutter/clutter/cogl/clutter-stage-cogl.h @@ -53,6 +53,7 @@ struct _ClutterStageCogl gint64 last_presentation_time; gint64 update_time; + int64_t last_update_time; /* We only enable clipped redraws after 2 frames, since we've seen * a lot of drivers can struggle to get going and may output some