Skip to content

Commit 483ff70

Browse files
author
Jonah Williams
authored
[iOS] clean ups to platform view controller (flutter#54335)
Splits FlutterPlatformViews.mm into the primarily C++ class FlutterPlatformViewsController/Pool/Overlay and all of the touch interceptor / gesture stuff. Renames FlutterPlatformViewsController to PlatformViewsController, because, you know. Renames FlutterPlatformViewLayer and FlutterPlatformViewLayerPool to OverlayLayer and OverlayLayerPool
1 parent fc5d81d commit 483ff70

24 files changed

Lines changed: 1039 additions & 937 deletions

ci/licenses_golden/licenses_flutter

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43652,7 +43652,6 @@ ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterOverl
4365243652
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h + ../../../flutter/LICENSE
4365343653
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm + ../../../flutter/LICENSE
4365443654
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPluginTest.mm + ../../../flutter/LICENSE
43655-
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm + ../../../flutter/LICENSE
4365643655
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm + ../../../flutter/LICENSE
4365743656
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h + ../../../flutter/LICENSE
4365843657
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm + ../../../flutter/LICENSE
@@ -43710,8 +43709,12 @@ ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/availability
4371043709
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/connection_collection.h + ../../../flutter/LICENSE
4371143710
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/connection_collection.mm + ../../../flutter/LICENSE
4371243711
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/connection_collection_test.mm + ../../../flutter/LICENSE
43712+
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/overlay_layer_pool.h + ../../../flutter/LICENSE
43713+
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/overlay_layer_pool.mm + ../../../flutter/LICENSE
4371343714
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h + ../../../flutter/LICENSE
4371443715
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm + ../../../flutter/LICENSE
43716+
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_views_controller.h + ../../../flutter/LICENSE
43717+
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_views_controller.mm + ../../../flutter/LICENSE
4371543718
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.h + ../../../flutter/LICENSE
4371643719
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm + ../../../flutter/LICENSE
4371743720
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h + ../../../flutter/LICENSE
@@ -46553,7 +46556,6 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterOverlay
4655346556
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h
4655446557
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm
4655546558
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPluginTest.mm
46556-
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm
4655746559
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm
4655846560
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h
4655946561
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm
@@ -46611,8 +46613,12 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/availability_v
4661146613
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/connection_collection.h
4661246614
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/connection_collection.mm
4661346615
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/connection_collection_test.mm
46616+
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/overlay_layer_pool.h
46617+
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/overlay_layer_pool.mm
4661446618
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h
4661546619
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm
46620+
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_views_controller.h
46621+
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_views_controller.mm
4661646622
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.h
4661746623
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm
4661846624
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h

shell/platform/darwin/ios/BUILD.gn

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ source_set("flutter_framework_source_arc") {
7777
"framework/Source/FlutterMetalLayer.mm",
7878
"framework/Source/FlutterOverlayView.h",
7979
"framework/Source/FlutterOverlayView.mm",
80-
"framework/Source/FlutterPlatformViews.mm",
8180
"framework/Source/FlutterPlatformViews_Internal.h",
8281
"framework/Source/FlutterPlatformViews_Internal.mm",
8382
"framework/Source/FlutterPluginAppLifeCycleDelegate.mm",
@@ -110,8 +109,12 @@ source_set("flutter_framework_source_arc") {
110109
"framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.mm",
111110
"framework/Source/connection_collection.h",
112111
"framework/Source/connection_collection.mm",
112+
"framework/Source/overlay_layer_pool.h",
113+
"framework/Source/overlay_layer_pool.mm",
113114
"framework/Source/platform_message_response_darwin.h",
114115
"framework/Source/platform_message_response_darwin.mm",
116+
"framework/Source/platform_views_controller.h",
117+
"framework/Source/platform_views_controller.mm",
115118
"framework/Source/profiler_metrics_ios.h",
116119
"framework/Source/profiler_metrics_ios.mm",
117120
"framework/Source/vsync_waiter_ios.h",

shell/platform/darwin/ios/framework/Source/FlutterEngine.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ @implementation FlutterEngine {
123123
fml::WeakNSObject<FlutterViewController> _viewController;
124124
fml::scoped_nsobject<FlutterDartVMServicePublisher> _publisher;
125125

126-
std::shared_ptr<flutter::FlutterPlatformViewsController> _platformViewsController;
126+
std::shared_ptr<flutter::PlatformViewsController> _platformViewsController;
127127
flutter::IOSRenderingAPI _renderingApi;
128128
std::shared_ptr<flutter::ProfilerMetricsIOS> _profiler_metrics;
129129
std::shared_ptr<flutter::SamplingProfiler> _profiler;
@@ -271,7 +271,7 @@ - (void)setUpApplicationLifecycleNotifications:(NSNotificationCenter*)center {
271271

272272
- (void)recreatePlatformViewController {
273273
_renderingApi = flutter::GetRenderingAPIForProcess(FlutterView.forceSoftwareRendering);
274-
_platformViewsController.reset(new flutter::FlutterPlatformViewsController());
274+
_platformViewsController.reset(new flutter::PlatformViewsController());
275275
}
276276

277277
- (flutter::IOSRenderingAPI)platformViewsRenderingAPI {
@@ -495,7 +495,7 @@ - (FlutterViewController*)viewController {
495495
- (FlutterPlatformPlugin*)platformPlugin {
496496
return _platformPlugin.get();
497497
}
498-
- (std::shared_ptr<flutter::FlutterPlatformViewsController>&)platformViewsController {
498+
- (std::shared_ptr<flutter::PlatformViewsController>&)platformViewsController {
499499
return _platformViewsController;
500500
}
501501
- (FlutterTextInputPlugin*)textInputPlugin {

shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extern NSString* const kFlutterEngineWillDealloc;
4848
base64Encode:(bool)base64Encode;
4949

5050
- (FlutterPlatformPlugin*)platformPlugin;
51-
- (std::shared_ptr<flutter::FlutterPlatformViewsController>&)platformViewsController;
51+
- (std::shared_ptr<flutter::PlatformViewsController>&)platformViewsController;
5252
- (FlutterTextInputPlugin*)textInputPlugin;
5353
- (FlutterRestorationPlugin*)restorationPlugin;
5454
- (void)launchEngine:(nullable NSString*)entrypoint

0 commit comments

Comments
 (0)