From 8055fe0b28b2b077a674d6f964b94d648d577d35 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Mon, 26 Oct 2020 09:45:09 -0700 Subject: [PATCH] [ios] Convert FlutterPlatformViewsController to smart pointer (flutter/engine#22082) * Convert FlutterPlatformViewsController to smart pointer * have a const reference of platform views controller * change more stuff to references --- .../darwin/ios/framework/Source/FlutterEngine.mm | 6 +++--- .../ios/framework/Source/FlutterEngine_Internal.h | 2 +- .../ios/framework/Source/FlutterPlatformViews.mm | 9 ++++----- .../darwin/ios/framework/Source/FlutterView.h | 2 +- .../ios/framework/Source/FlutterViewController.mm | 2 +- .../framework/Source/FlutterViewController_Internal.h | 2 +- .../darwin/ios/framework/Source/SemanticsObject.mm | 3 +-- .../ios/framework/Source/SemanticsObjectTest.mm | 4 +++- .../ios/framework/Source/accessibility_bridge.h | 6 +++--- .../ios/framework/Source/accessibility_bridge.mm | 11 ++++++----- .../ios/framework/Source/accessibility_bridge_ios.h | 3 ++- .../ios/framework/Source/accessibility_bridge_test.mm | 4 ++-- .../platform/darwin/ios/ios_external_view_embedder.h | 9 +++++---- .../platform/darwin/ios/ios_external_view_embedder.mm | 2 +- .../flutter/shell/platform/darwin/ios/ios_surface.h | 4 ++-- .../flutter/shell/platform/darwin/ios/ios_surface.mm | 7 ++++--- .../shell/platform/darwin/ios/ios_surface_gl.h | 7 ++++--- .../shell/platform/darwin/ios/ios_surface_gl.mm | 7 ++++--- .../shell/platform/darwin/ios/ios_surface_metal.h | 2 +- .../shell/platform/darwin/ios/ios_surface_metal.mm | 7 ++++--- .../shell/platform/darwin/ios/ios_surface_software.h | 7 ++++--- .../shell/platform/darwin/ios/ios_surface_software.mm | 7 ++++--- 22 files changed, 61 insertions(+), 52 deletions(-) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm index f4f071d2fc..8a0de614f1 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm @@ -63,7 +63,7 @@ static constexpr int kNumProfilerSamplesPerSec = 5; fml::WeakPtr _viewController; fml::scoped_nsobject _publisher; - std::unique_ptr _platformViewsController; + std::shared_ptr _platformViewsController; std::unique_ptr _profiler_metrics; std::unique_ptr _profiler; @@ -311,8 +311,8 @@ static constexpr int kNumProfilerSamplesPerSec = 5; - (FlutterPlatformPlugin*)platformPlugin { return _platformPlugin.get(); } -- (flutter::FlutterPlatformViewsController*)platformViewsController { - return _platformViewsController.get(); +- (std::shared_ptr&)platformViewsController { + return _platformViewsController; } - (FlutterTextInputPlugin*)textInputPlugin { return _textInputPlugin.get(); diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h index 13fdfa0dab..85a82f3891 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h @@ -38,7 +38,7 @@ base64Encode:(bool)base64Encode; - (FlutterPlatformPlugin*)platformPlugin; -- (flutter::FlutterPlatformViewsController*)platformViewsController; +- (std::shared_ptr&)platformViewsController; - (FlutterTextInputPlugin*)textInputPlugin; - (void)launchEngine:(NSString*)entrypoint libraryURI:(NSString*)libraryOrNil; - (BOOL)createShell:(NSString*)entrypoint diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm index c0c185c6ee..2d14282d09 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm @@ -884,16 +884,16 @@ void FlutterPlatformViewsController::CommitCATransactionIfNeeded() { } - (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { - [_platformViewsController.get()->getFlutterViewController() touchesBegan:touches withEvent:event]; + [_platformViewsController->getFlutterViewController() touchesBegan:touches withEvent:event]; _currentTouchPointersCount += touches.count; } - (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { - [_platformViewsController.get()->getFlutterViewController() touchesMoved:touches withEvent:event]; + [_platformViewsController->getFlutterViewController() touchesMoved:touches withEvent:event]; } - (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event { - [_platformViewsController.get()->getFlutterViewController() touchesEnded:touches withEvent:event]; + [_platformViewsController->getFlutterViewController() touchesEnded:touches withEvent:event]; _currentTouchPointersCount -= touches.count; // Touches in one touch sequence are sent to the touchesEnded method separately if different // fingers stop touching the screen at different time. So one touchesEnded method triggering does @@ -905,8 +905,7 @@ void FlutterPlatformViewsController::CommitCATransactionIfNeeded() { } - (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event { - [_platformViewsController.get()->getFlutterViewController() touchesCancelled:touches - withEvent:event]; + [_platformViewsController->getFlutterViewController() touchesCancelled:touches withEvent:event]; _currentTouchPointersCount = 0; self.state = UIGestureRecognizerStateFailed; } diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h index 3a9c138de0..b874bbc863 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h @@ -20,7 +20,7 @@ - (flutter::Rasterizer::Screenshot)takeScreenshot:(flutter::Rasterizer::ScreenshotType)type asBase64Encoded:(BOOL)base64Encode; -- (flutter::FlutterPlatformViewsController*)platformViewsController; +- (std::shared_ptr&)platformViewsController; @end @interface FlutterView : UIView diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index ba2a525f70..7f593583a5 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -1332,7 +1332,7 @@ static flutter::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* touch) #pragma mark - Platform views -- (flutter::FlutterPlatformViewsController*)platformViewsController { +- (std::shared_ptr&)platformViewsController { return [_engine.get() platformViewsController]; } diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h index 367da8b809..93584f237b 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h @@ -26,7 +26,7 @@ extern NSNotificationName const FlutterViewControllerShowHomeIndicator; @property(nonatomic, readonly) BOOL isPresentingViewController; - (fml::WeakPtr)getWeakPtr; -- (flutter::FlutterPlatformViewsController*)platformViewsController; +- (std::shared_ptr&)platformViewsController; @end diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.mm index d41f0a40ae..76593f3fa7 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.mm @@ -557,8 +557,7 @@ flutter::SemanticsAction GetSemanticsActionForScrollDirection( // `accessibilityContainer` and `accessibilityElementAtIndex`. if (self = [super initWithAccessibilityContainer:object.bridge->view()]) { _semanticsObject = object; - flutter::FlutterPlatformViewsController* controller = - object.bridge->GetPlatformViewsController(); + auto controller = object.bridge->GetPlatformViewsController(); if (controller) { _platformView = [[controller->GetPlatformViewByID(object.node.platformViewId) view] retain]; } diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm index 6234130c45..283a8fbbd5 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm @@ -39,7 +39,9 @@ class MockAccessibilityBridge : public AccessibilityBridgeIos { } void AccessibilityObjectDidBecomeFocused(int32_t id) override {} void AccessibilityObjectDidLoseFocus(int32_t id) override {} - FlutterPlatformViewsController* GetPlatformViewsController() const override { return nil; } + std::shared_ptr GetPlatformViewsController() const override { + return nil; + } std::vector observations; private: diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h index 7a6d2ff5d0..1e38a3b0de 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h @@ -51,7 +51,7 @@ class AccessibilityBridge final : public AccessibilityBridgeIos { AccessibilityBridge(FlutterViewController* view_controller, PlatformViewIOS* platform_view, - FlutterPlatformViewsController* platform_views_controller, + std::shared_ptr platform_views_controller, std::unique_ptr ios_delegate = nullptr); ~AccessibilityBridge(); @@ -70,7 +70,7 @@ class AccessibilityBridge final : public AccessibilityBridgeIos { fml::WeakPtr GetWeakPtr(); - FlutterPlatformViewsController* GetPlatformViewsController() const override { + std::shared_ptr GetPlatformViewsController() const override { return platform_views_controller_; }; @@ -85,7 +85,7 @@ class AccessibilityBridge final : public AccessibilityBridgeIos { FlutterViewController* view_controller_; PlatformViewIOS* platform_view_; - FlutterPlatformViewsController* platform_views_controller_; + const std::shared_ptr platform_views_controller_; // If the this id is kSemanticObjectIdInvalid, it means either nothing has // been focused or the focus is currently outside of the flutter application // (i.e. the status bar or keyboard) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index e5b19fadd9..763826f99f 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -36,10 +36,11 @@ class DefaultIosDelegate : public AccessibilityBridge::IosDelegate { }; } // namespace -AccessibilityBridge::AccessibilityBridge(FlutterViewController* view_controller, - PlatformViewIOS* platform_view, - FlutterPlatformViewsController* platform_views_controller, - std::unique_ptr ios_delegate) +AccessibilityBridge::AccessibilityBridge( + FlutterViewController* view_controller, + PlatformViewIOS* platform_view, + std::shared_ptr platform_views_controller, + std::unique_ptr ios_delegate) : view_controller_(view_controller), platform_view_(platform_view), platform_views_controller_(platform_views_controller), @@ -126,7 +127,7 @@ void AccessibilityBridge::UpdateSemantics(flutter::SemanticsNodeUpdates nodes, } if (object.node.IsPlatformViewNode()) { - FlutterPlatformViewsController* controller = GetPlatformViewsController(); + auto controller = GetPlatformViewsController(); if (controller) { object.platformViewSemanticsContainer = [[[FlutterPlatformViewSemanticsContainer alloc] initWithSemanticsObject:object] autorelease]; diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge_ios.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge_ios.h index 3b28a95292..3be237473e 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge_ios.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge_ios.h @@ -5,6 +5,7 @@ #ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_ACCESSIBILITY_BRIDGE_IOS_H_ #define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_ACCESSIBILITY_BRIDGE_IOS_H_ +#include #include #include "flutter/lib/ui/semantics/semantics_node.h" @@ -36,7 +37,7 @@ class AccessibilityBridgeIos { * The input id is the uid of the newly focused SemanticObject. */ virtual void AccessibilityObjectDidLoseFocus(int32_t id) = 0; - virtual FlutterPlatformViewsController* GetPlatformViewsController() const = 0; + virtual std::shared_ptr GetPlatformViewsController() const = 0; }; } // namespace flutter diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm index bc6a6ebdc0..fea18becd8 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm @@ -234,7 +234,7 @@ fml::RefPtr CreateNewThread(std::string name) { std::string label = "some label"; auto flutterPlatformViewsController = - std::make_unique(); + std::make_shared(); flutterPlatformViewsController->SetFlutterView(mockFlutterView); MockFlutterPlatformFactory* factory = [[MockFlutterPlatformFactory new] autorelease]; @@ -252,7 +252,7 @@ fml::RefPtr CreateNewThread(std::string name) { auto bridge = std::make_unique( /*view_controller=*/mockFlutterViewController, /*platform_view=*/platform_view.get(), - /*platform_views_controller=*/flutterPlatformViewsController.get()); + /*platform_views_controller=*/flutterPlatformViewsController); flutter::SemanticsNodeUpdates nodes; flutter::SemanticsNode semantics_node; diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_external_view_embedder.h b/engine/src/flutter/shell/platform/darwin/ios/ios_external_view_embedder.h index e717c2ef2a..6c023d1b79 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_external_view_embedder.h +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_external_view_embedder.h @@ -12,15 +12,16 @@ namespace flutter { class IOSExternalViewEmbedder : public ExternalViewEmbedder { public: - IOSExternalViewEmbedder( - FlutterPlatformViewsController* platform_views_controller, - std::shared_ptr context); + IOSExternalViewEmbedder(const std::shared_ptr& + platform_views_controller, + std::shared_ptr context); // |ExternalViewEmbedder| virtual ~IOSExternalViewEmbedder() override; private: - FlutterPlatformViewsController* platform_views_controller_; + const std::shared_ptr& + platform_views_controller_; std::shared_ptr ios_context_; // |ExternalViewEmbedder| diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_external_view_embedder.mm b/engine/src/flutter/shell/platform/darwin/ios/ios_external_view_embedder.mm index 8939b49116..46cb3014b6 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_external_view_embedder.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_external_view_embedder.mm @@ -7,7 +7,7 @@ namespace flutter { IOSExternalViewEmbedder::IOSExternalViewEmbedder( - FlutterPlatformViewsController* platform_views_controller, + const std::shared_ptr& platform_views_controller, std::shared_ptr context) : platform_views_controller_(platform_views_controller), ios_context_(context) { FML_CHECK(ios_context_); diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface.h b/engine/src/flutter/shell/platform/darwin/ios/ios_surface.h index 8935b7537b..3a3ec5da18 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface.h +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface.h @@ -28,7 +28,7 @@ class IOSSurface { static std::unique_ptr Create( std::shared_ptr context, fml::scoped_nsobject layer, - FlutterPlatformViewsController* platform_views_controller); + const std::shared_ptr& platform_views_controller); std::shared_ptr GetContext() const; @@ -49,7 +49,7 @@ class IOSSurface { protected: IOSSurface(std::shared_ptr ios_context, - FlutterPlatformViewsController* platform_views_controller); + const std::shared_ptr& platform_views_controller); private: std::shared_ptr ios_context_; diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface.mm b/engine/src/flutter/shell/platform/darwin/ios/ios_surface.mm index 49b418a943..0f4a47da83 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface.mm @@ -18,7 +18,7 @@ namespace flutter { std::unique_ptr IOSSurface::Create( std::shared_ptr context, fml::scoped_nsobject layer, - FlutterPlatformViewsController* platform_views_controller) { + const std::shared_ptr& platform_views_controller) { FML_DCHECK(layer); FML_DCHECK(context); @@ -51,8 +51,9 @@ std::unique_ptr IOSSurface::Create( ); } -IOSSurface::IOSSurface(std::shared_ptr ios_context, - FlutterPlatformViewsController* platform_views_controller) +IOSSurface::IOSSurface( + std::shared_ptr ios_context, + const std::shared_ptr& platform_views_controller) : ios_context_(std::move(ios_context)) { FML_DCHECK(ios_context_); external_view_embedder_ = diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.h b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.h index ca40ffed43..bd65457a8c 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.h +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.h @@ -18,9 +18,10 @@ namespace flutter { class IOSSurfaceGL final : public IOSSurface, public GPUSurfaceGLDelegate { public: - IOSSurfaceGL(fml::scoped_nsobject layer, - std::shared_ptr context, - FlutterPlatformViewsController* platform_views_controller = nullptr); + IOSSurfaceGL( + fml::scoped_nsobject layer, + std::shared_ptr context, + const std::shared_ptr& platform_views_controller = nullptr); ~IOSSurfaceGL() override; diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.mm b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.mm index e114d5efee..06732dba5a 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.mm @@ -14,9 +14,10 @@ static IOSContextGL* CastToGLContext(const std::shared_ptr& context) return reinterpret_cast(context.get()); } -IOSSurfaceGL::IOSSurfaceGL(fml::scoped_nsobject layer, - std::shared_ptr context, - FlutterPlatformViewsController* platform_views_controller) +IOSSurfaceGL::IOSSurfaceGL( + fml::scoped_nsobject layer, + std::shared_ptr context, + const std::shared_ptr& platform_views_controller) : IOSSurface(context, platform_views_controller) { render_target_ = CastToGLContext(context)->CreateRenderTarget(std::move(layer)); } diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_metal.h b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_metal.h index c449248eda..5b2f04d336 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_metal.h +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_metal.h @@ -19,7 +19,7 @@ class SK_API_AVAILABLE_CA_METAL_LAYER IOSSurfaceMetal final : public IOSSurface, public: IOSSurfaceMetal(fml::scoped_nsobject layer, std::shared_ptr context, - FlutterPlatformViewsController* platform_views_controller); + const std::shared_ptr& platform_views_controller); // |IOSSurface| ~IOSSurfaceMetal() override; diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_metal.mm b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_metal.mm index ee240bd96a..6f73110b76 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_metal.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_metal.mm @@ -13,9 +13,10 @@ static IOSContextMetal* CastToMetalContext(const std::shared_ptr& co return reinterpret_cast(context.get()); } -IOSSurfaceMetal::IOSSurfaceMetal(fml::scoped_nsobject layer, - std::shared_ptr context, - FlutterPlatformViewsController* platform_views_controller) +IOSSurfaceMetal::IOSSurfaceMetal( + fml::scoped_nsobject layer, + std::shared_ptr context, + const std::shared_ptr& platform_views_controller) : IOSSurface(std::move(context), platform_views_controller), layer_(std::move(layer)) { if (!layer_) { return; diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.h b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.h index 59242f3580..31492b8128 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.h +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.h @@ -18,9 +18,10 @@ namespace flutter { class IOSSurfaceSoftware final : public IOSSurface, public GPUSurfaceSoftwareDelegate { public: - IOSSurfaceSoftware(fml::scoped_nsobject layer, - std::shared_ptr context, - FlutterPlatformViewsController* platform_views_controller); + IOSSurfaceSoftware( + fml::scoped_nsobject layer, + std::shared_ptr context, + const std::shared_ptr& platform_views_controller); ~IOSSurfaceSoftware() override; diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.mm b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.mm index 7b5c2ee8ad..501492652c 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.mm @@ -15,9 +15,10 @@ namespace flutter { -IOSSurfaceSoftware::IOSSurfaceSoftware(fml::scoped_nsobject layer, - std::shared_ptr context, - FlutterPlatformViewsController* platform_views_controller) +IOSSurfaceSoftware::IOSSurfaceSoftware( + fml::scoped_nsobject layer, + std::shared_ptr context, + const std::shared_ptr& platform_views_controller) : IOSSurface(std::move(context), platform_views_controller), layer_(std::move(layer)) {} IOSSurfaceSoftware::~IOSSurfaceSoftware() = default;