Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vsync_waiter_fallback should schedule firecallback for future #28817

Merged
merged 3 commits into from
Sep 29, 2021

Conversation

iskakaushik
Copy link
Contributor

This makes the impl consistent with how other platforms implement
vsyncs. This also ensures that we always pause the microtasks for the
minimal time possible.

Fixes: flutter/flutter#89786

This makes the impl consistent with how other platforms implement
vsyncs. This also ensures that we always pause the microtasks for the
minimal time possible.

Fixes: flutter/flutter#89786
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@iskakaushik iskakaushik added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Sep 29, 2021
@@ -95,6 +97,8 @@ void VsyncWaiter::ScheduleSecondaryCallback(uintptr_t id,
void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the headerdocs for this protected method, can you document that this subclasses must invoke this at (or close to because of scheduling overhead), the frame start time? Also, can you drop a note in the PR commit message that says verification of all vsync waiter subclasses was done to account for the new assertion for the start time requirements in FireCallback.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! will also add the comment when I merge.

@@ -2,9 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#define FML_USED_ON_EMBEDDER
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is not in the embedder, it seems odd to lift this gate here. This was done so that custom embedders with no custom event loop integration would continue to function. I think this may not be necessary anymore though.

Anyway, the base fml::TaskRunner has a protected task_runners_ field from you can grab a reference to the task runner you need. No need to use this define to access the current task runner.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@iskakaushik iskakaushik removed the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Sep 29, 2021
@iskakaushik iskakaushik added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Sep 29, 2021
@fluttergithubbot fluttergithubbot merged commit edf8fc8 into flutter:master Sep 29, 2021
akbiggs pushed a commit to akbiggs/engine that referenced this pull request Oct 1, 2021
dnfield pushed a commit to dnfield/engine that referenced this pull request Oct 6, 2021
akbiggs added a commit to akbiggs/engine that referenced this pull request Oct 21, 2021
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Oct 29, 2021
Prior to flutter#28817 super class vsync
waiter would post the tast to the future if the frame start time is at a
later poit. This change made it so that the sub classes are responsible
for posting the task at the right time.

This change makes it so that vsync waiter embedder respects that
contract.

Fixes flutter/flutter#92603
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes needs tests waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slow network request while loading widgets on screen
4 participants