Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Don't call OnAnimatorNotifyIdle if a frame is scheduled #7746

Merged
merged 1 commit into from
Feb 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions shell/common/animator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,13 @@ void Animator::BeginFrame(fml::TimePoint frame_start_time,
if (!self.get()) {
return;
}
// If our (this task's) task id is the same as the current one, then
// no further frames were produced, and it is safe (w.r.t. jank) to
// notify the engine we are idle.
if (notify_idle_task_id == self->notify_idle_task_id_) {
// If our (this task's) task id is the same as the current one
// (meaning there were no follow up frames to the |BeginFrame| call
// that posted this task) and no frame is currently scheduled, then
// assume that we are idle, and notify the engine of this.
if (notify_idle_task_id == self->notify_idle_task_id_ &&
!self->frame_scheduled_) {
TRACE_EVENT0("flutter", "BeginFrame idle callback");
self->delegate_.OnAnimatorNotifyIdle(Dart_TimelineGetMicros() +
100000);
}
Expand Down