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

Commit dd3383d

Browse files
authored
Revert "[macOS] Use CVDisplayLink to drive repaint (#49159)" (#51095)
The original PR assumed that `fml::TimePoint` has same base as `CACurrentMediaTime()`. However due to recent change in Dart SDK that's no longer true. Dart SDK [replaced](https://dart-review.googlesource.com/c/sdk/+/348044?tab=comments) call to `mach_absolute_time` with `clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW)`, while `CACurrentMediaTime()` corresponds to `CLOCK_UPTIME_RAW`. This needs to be fixed either in Dart SDK dart-lang/sdk#55071 or the original PR needs to be relanded with appropriate conversions. This reverts commit 21474ee. *Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* *List which issues are fixed by this PR. You must list at least one issue.* *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I signed the [CLA]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style [testing the engine]: https://github.com/flutter/flutter/wiki/Testing-the-engine [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
1 parent 7e8fefe commit dd3383d

23 files changed

+36
-1112
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36586,7 +36586,6 @@ ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterCom
3658636586
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm + ../../../flutter/LICENSE
3658736587
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterDartProject.mm + ../../../flutter/LICENSE
3658836588
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterDartProject_Internal.h + ../../../flutter/LICENSE
36589-
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterDisplayLinkTest.mm + ../../../flutter/LICENSE
3659036589
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterEmbedderExternalTextureTest.mm + ../../../flutter/LICENSE
3659136590
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.h + ../../../flutter/LICENSE
3659236591
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm + ../../../flutter/LICENSE
@@ -36637,7 +36636,6 @@ ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterThr
3663736636
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterThreadSynchronizer.mm + ../../../flutter/LICENSE
3663836637
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterThreadSynchronizerTest.mm + ../../../flutter/LICENSE
3663936638
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterUmbrellaImportTests.m + ../../../flutter/LICENSE
36640-
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterVSyncWaiterTest.mm + ../../../flutter/LICENSE
3664136639
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterView.h + ../../../flutter/LICENSE
3664236640
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterView.mm + ../../../flutter/LICENSE
3664336641
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm + ../../../flutter/LICENSE
@@ -39449,9 +39447,6 @@ FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterCompo
3944939447
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm
3945039448
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterDartProject.mm
3945139449
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterDartProject_Internal.h
39452-
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterDisplayLink.h
39453-
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterDisplayLink.mm
39454-
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterDisplayLinkTest.mm
3945539450
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterEmbedderExternalTextureTest.mm
3945639451
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.h
3945739452
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm
@@ -39502,9 +39497,6 @@ FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterThrea
3950239497
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterThreadSynchronizer.mm
3950339498
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterThreadSynchronizerTest.mm
3950439499
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterUmbrellaImportTests.m
39505-
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterVSyncWaiter.h
39506-
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterVSyncWaiter.mm
39507-
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterVSyncWaiterTest.mm
3950839500
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterView.h
3950939501
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterView.mm
3951039502
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm

shell/platform/darwin/macos/BUILD.gn

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ source_set("flutter_framework_source") {
6666
"framework/Source/FlutterCompositor.mm",
6767
"framework/Source/FlutterDartProject.mm",
6868
"framework/Source/FlutterDartProject_Internal.h",
69-
"framework/Source/FlutterDisplayLink.h",
70-
"framework/Source/FlutterDisplayLink.mm",
7169
"framework/Source/FlutterEmbedderKeyResponder.h",
7270
"framework/Source/FlutterEmbedderKeyResponder.mm",
7371
"framework/Source/FlutterEngine.mm",
@@ -103,8 +101,6 @@ source_set("flutter_framework_source") {
103101
"framework/Source/FlutterTextureRegistrar.mm",
104102
"framework/Source/FlutterThreadSynchronizer.h",
105103
"framework/Source/FlutterThreadSynchronizer.mm",
106-
"framework/Source/FlutterVSyncWaiter.h",
107-
"framework/Source/FlutterVSyncWaiter.mm",
108104
"framework/Source/FlutterView.h",
109105
"framework/Source/FlutterView.mm",
110106
"framework/Source/FlutterViewController.mm",
@@ -177,7 +173,6 @@ executable("flutter_desktop_darwin_unittests") {
177173
"framework/Source/FlutterAppDelegateTest.mm",
178174
"framework/Source/FlutterAppLifecycleDelegateTest.mm",
179175
"framework/Source/FlutterChannelKeyResponderTest.mm",
180-
"framework/Source/FlutterDisplayLinkTest.mm",
181176
"framework/Source/FlutterEmbedderExternalTextureTest.mm",
182177
"framework/Source/FlutterEmbedderKeyResponderTest.mm",
183178
"framework/Source/FlutterEngineTest.mm",
@@ -192,7 +187,6 @@ executable("flutter_desktop_darwin_unittests") {
192187
"framework/Source/FlutterTextInputPluginTest.mm",
193188
"framework/Source/FlutterTextInputSemanticsObjectTest.mm",
194189
"framework/Source/FlutterThreadSynchronizerTest.mm",
195-
"framework/Source/FlutterVSyncWaiterTest.mm",
196190
"framework/Source/FlutterViewControllerTest.mm",
197191
"framework/Source/FlutterViewControllerTestUtils.h",
198192
"framework/Source/FlutterViewControllerTestUtils.mm",

shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,10 @@
6969
}
7070
}
7171

72-
CFTimeInterval presentation_time = 0;
73-
74-
if (layers_count > 0 && layers[0]->presentation_time != 0) {
75-
presentation_time = layers[0]->presentation_time / 1'000'000'000.0;
76-
}
77-
78-
[view.surfaceManager presentSurfaces:surfaces
79-
atTime:presentation_time
80-
notify:^{
81-
PresentPlatformViews(view, layers, layers_count);
82-
}];
72+
[view.surfaceManager present:surfaces
73+
notify:^{
74+
PresentPlatformViews(view, layers, layers_count);
75+
}];
8376

8477
return true;
8578
}

shell/platform/darwin/macos/framework/Source/FlutterDisplayLink.h

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)