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

Conversation

@iskakaushik
Copy link
Contributor

No description provided.

if (delta < presentation_interval) {
return last_frame_presentation_time + presentation_interval;
} else {
int64_t num_phases_passed = delta / presentation_interval;
Copy link
Contributor

Choose a reason for hiding this comment

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

unsigned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure it matters here since the overloaded division operator in TimeDelta is int64_t though as you point out it ought to be unsigned. Leaving this as is for now.

/// will be the same.
///
/// Scenario 1:
/// presentation_interval is 2
Copy link
Contributor

Choose a reason for hiding this comment

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

can we clarify here that presentation_interval is a time delta, not the number of frames

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The type of the param is fml::TimeDelta as opposed to an integral type, so this should be clear once the reader gets to the method definition.

} else {
int64_t num_phases_passed = delta / presentation_interval;
// this is to ensure that we will be past the "now" time point.
if (delta % presentation_interval == fml::TimeDelta::Zero()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I fully understand this. I think it's supposed to be iterating over to the first future timepoint at which a presentation is scheduled to occur, so e.g. if we have a delta of 20ms since the last presentation, and the presentation interval is 16ms, we're 4ms into the budget for the n+1 frame, which means we need to return a timepoint 12ms in the future from now, is this correct?

In this expression, 20 % 16 != 0 so we won't be adding to the phases passed, and the integer division above should return the floor so we'd be returning a timepoint in the past?

last_frame_presentation_time = 0
presentation_interval = 16
now = 20
delta = 20
num_phases_passed = 20 / 16 = 1
delta % presentation_interval = 20 % 16 = 4

return 0 + (16 * 1) = 16?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I meant to do a ceil and was accounting for the case where there is a perfect division. good catch, will add a test for this.

@iskakaushik iskakaushik force-pushed the add-better-docs-for-snap branch from 776c7c5 to bf40301 Compare December 6, 2019 20:08
Copy link
Contributor

@gw280 gw280 left a comment

Choose a reason for hiding this comment

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

LGTM with Chinmay's comments

@iskakaushik iskakaushik force-pushed the add-better-docs-for-snap branch from bf40301 to 3fc2e37 Compare December 6, 2019 21:08
@iskakaushik iskakaushik force-pushed the add-better-docs-for-snap branch from 3fc2e37 to a957ba3 Compare December 6, 2019 21:09
@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 Dec 6, 2019
@iskakaushik iskakaushik merged commit f5250ec into flutter:master Dec 6, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 6, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 6, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 6, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 7, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 8, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 8, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 8, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 9, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 9, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 9, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 9, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 9, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 9, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 9, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 9, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 9, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 9, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 9, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Dec 9, 2019
flutter/engine@e7b69ce...5b870a2

git log e7b69ce..5b870a2 --first-parent --oneline
2019-12-08 [email protected] Add support for setting window size limits for glfw (flutter/engine#13415)
2019-12-06 [email protected] [fuchsia] SnapToNextPhase refactor + add tests and documentation (flutter/engine#14158)
2019-12-06 [email protected] Roll fuchsia/sdk/core/mac-amd64 from VKso5... to 9C6UA... (flutter/engine#14161)


If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes 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.

4 participants