mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 08:30:42 -05:00
wayland: Flatten logic in on_after_update()
Slightly improves the cognitive complexity of the function. No change in behavior. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3521>
This commit is contained in:
parent
26d8b9c69b
commit
d5c2f20d55
@ -297,6 +297,7 @@ on_after_update (ClutterStage *stage,
|
|||||||
GSource *source;
|
GSource *source;
|
||||||
int64_t min_render_time_allowed_us;
|
int64_t min_render_time_allowed_us;
|
||||||
int64_t target_presentation_time_us;
|
int64_t target_presentation_time_us;
|
||||||
|
int64_t frame_deadline_us;
|
||||||
|
|
||||||
if (!META_IS_BACKEND_NATIVE (backend))
|
if (!META_IS_BACKEND_NATIVE (backend))
|
||||||
{
|
{
|
||||||
@ -316,27 +317,23 @@ on_after_update (ClutterStage *stage,
|
|||||||
{
|
{
|
||||||
g_source_set_ready_time (source, -1);
|
g_source_set_ready_time (source, -1);
|
||||||
emit_frame_callbacks_for_stage_view (compositor, stage_view);
|
emit_frame_callbacks_for_stage_view (compositor, stage_view);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
frame_deadline_us = target_presentation_time_us -
|
||||||
|
min_render_time_allowed_us;
|
||||||
|
|
||||||
|
if (frame_deadline_us <= g_get_monotonic_time ())
|
||||||
{
|
{
|
||||||
int64_t frame_deadline_us;
|
g_source_set_ready_time (source, -1);
|
||||||
|
emit_frame_callbacks_for_stage_view (compositor, stage_view);
|
||||||
frame_deadline_us = target_presentation_time_us -
|
return;
|
||||||
min_render_time_allowed_us;
|
|
||||||
|
|
||||||
if (frame_deadline_us <= g_get_monotonic_time ())
|
|
||||||
{
|
|
||||||
g_source_set_ready_time (source, -1);
|
|
||||||
emit_frame_callbacks_for_stage_view (compositor, stage_view);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (g_source_get_ready_time (source) != -1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
g_source_set_ready_time (source, frame_deadline_us);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_source_get_ready_time (source) != -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
g_source_set_ready_time (source, frame_deadline_us);
|
||||||
#else
|
#else
|
||||||
emit_frame_callbacks_for_stage_view (compositor, stage_view);
|
emit_frame_callbacks_for_stage_view (compositor, stage_view);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user