This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Break dependency cycle of FlutterViewController <-> FlutterPlatformView #52271
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36251cd
to
554bfa5
Compare
jmagman
commented
Apr 19, 2024
@@ -1198,7 +1190,7 @@ - (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event { | |||
// Flutter needs all the cancelled touches to be "cancelled" change types in order to correctly | |||
// handle gesture sequence. | |||
// We always override the change type to "cancelled". | |||
[((FlutterViewController*)_flutterViewController.get()) forceTouchesCancelled:touches]; | |||
[_flutterViewController.get() forceTouchesCancelled:touches]; |
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.
(Removing FlutterViewController
here)
554bfa5
to
c632ba2
Compare
jmagman
commented
Apr 22, 2024
@@ -60,9 +60,6 @@ typedef void (^FlutterKeyboardAnimationCallback)(fml::TimePoint); | |||
- (fml::WeakNSObject<FlutterViewController>)getWeakNSObject; | |||
- (std::shared_ptr<flutter::FlutterPlatformViewsController>&)platformViewsController; | |||
- (FlutterRestorationPlugin*)restorationPlugin; | |||
// Send touches to the Flutter Engine while forcing the change type to be cancelled. | |||
// The `phase`s in `touches` are ignored. | |||
- (void)forceTouchesCancelled:(NSSet*)touches; |
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.
Moved to FlutterViewResponder.h
hellohuanlin
approved these changes
Apr 22, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 22, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 22, 2024
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Apr 23, 2024
…147190) flutter/engine@a4b71f0...33c828f 2024-04-22 [email protected] Roll Skia from eb29b46236e6 to 3b32e3280b67 (1 revision) (flutter/engine#52298) 2024-04-22 [email protected] Break dependency cycle of FlutterViewController <-> FlutterPlatformView (flutter/engine#52271) 2024-04-22 [email protected] [et] Lookup output filesystem path, not label (flutter/engine#52248) 2024-04-22 [email protected] Roll Skia from 975859a96f8f to eb29b46236e6 (9 revisions) (flutter/engine#52297) 2024-04-22 [email protected] [canvaskit] Add configuration for maximum canvases (flutter/engine#51735) 2024-04-22 [email protected] Fix link in BlendMode.saturation (flutter/engine#52156) 2024-04-22 [email protected] Refactor and migrate FlutterUndoManagerPlugin to ARC (flutter/engine#52234) 2024-04-22 [email protected] Roll Fuchsia Linux SDK from Rr9lFiKCPhMXDGa89... to L533ubzhjWwW7jxbc... (flutter/engine#52293) 2024-04-22 [email protected] Roll Dart SDK from 0a83dd7e61b1 to 0ed66a4d77cb (1 revision) (flutter/engine#52294) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from Rr9lFiKCPhMX to L533ubzhjWwW 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],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
9 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trying to migrate the iOS embedder MRC to ARC, I'm attempting to break some dependency cycles so it's easier to migrate the "leaf" dependencies to ARC, working my way up.
The cycle is:
FlutterViewController
->FlutterView
->FlutterPlatformView
-> (Before this PR)FlutterViewController
FlutterViewController
depends on many other large MRC classes, like FlutterEngine., so I'd like to pull that one out soFlutterView
,FlutterPlatformView
, andFlutterOverlayView
can be migrated to ARC in a smaller PR.FlutterPlatformView
only depends onFlutterViewController
in this one place, casting aUIViewController
and calling-forceTouchesCancelled:
.engine/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm
Line 1201 in 55670b7
Instead, move
-forceTouchesCancelled:
to the existingFlutterViewResponder
protocol with the other touch events, whichFlutterViewController
already implements. The cast can then be removed, breaking the cycle.Clean up all the imports.
Part of flutter/flutter#137801, though this doesn't actually migrate anything to ARC.