-
Notifications
You must be signed in to change notification settings - Fork 6k
Always update the latest frame target time when the 'Animator::Render' method is called #31973
Always update the latest frame target time when the 'Animator::Render' method is called #31973
Conversation
…' method is called
|
friendly ping |
shell/common/animator_unittests.cc
Outdated
|
|
||
| // It will only be called once even though we call the method Animator::Render | ||
| // twice. because it will only be called when the pipeline is empty. | ||
| // It should always be called when the method 'Animator::Render' is called, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should -> must
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| "Animator::Render"); | ||
| frame_timings_recorder_->RecordBuildEnd(fml::TimePoint::Now()); | ||
|
|
||
| delegate_.OnAnimatorUpdateLatestFrameTargetTime( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this safe to access without a lock?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's safe, the lock is in Shell::OnAnimatorUpdateLatestFrameTargetTime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I meant for this comment to be in the line below this (frame_timings_recorder_->GetVsyncTargetTime()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now though that takes a lock by itself.
| // record the target time for use by rasterizer. | ||
| { | ||
| std::scoped_lock time_recorder_lock(time_recorder_mutex_); | ||
| const fml::TimePoint frame_target_time = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need the lock here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need it, because the Rasterizer will still call Shell::GetLatestFrameTargetTime to access latest_frame_target_time_ on the raster thread.
dnfield
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…::Render' method is called (flutter/engine#31973)
tiny patch for #31727
We should always update the latest frame target time when the method 'Animator::Render' is called, regardless of whether the pipeline is empty or not.
Pre-launch Checklist
writing and running engine tests.
///).