From 32122ba8a64d263fa3a1b7d8e9d2a13088f1f06d Mon Sep 17 00:00:00 2001 From: Amir Hardon Date: Tue, 27 Nov 2018 06:33:56 -0800 Subject: [PATCH 1/2] Update Dartdoc for SceneBuilder#addPlatformView --- lib/ui/compositing.dart | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/ui/compositing.dart b/lib/ui/compositing.dart index a23c2bbbb9d6c..50af0e068f785 100644 --- a/lib/ui/compositing.dart +++ b/lib/ui/compositing.dart @@ -274,7 +274,20 @@ class SceneBuilder extends NativeFieldWrapperClass2 { /// Adds a platform view (e.g an iOS UIView) to the scene. /// - /// This is work in progress and is not currently supported on any platform. + /// Only supported on iOS, this is currently a no-op on other platforms. + /// + /// On iOS this layer splits the current output surface into 2 surfaces, one for the scene nodes + /// preceding the platform view, and one for the scene nodes following the platform view. + /// + /// ## Performance impact + /// + /// Adding an additional surface doubles the amount of graphics memory directly used by Flutter + /// for output buffers. Quartz might allocated extra buffers for compositing the Flutter surfaces + /// and the platform view. + /// + /// With a platform view in the scene, Quarts has to composite the 2 Flutter surfaces and the + /// embedded UIView. In addition to that, on iOS versions greater than 9, the Flutter frames are + /// synchronized with the UIView frames adding additional performance overhead. void addPlatformView(int viewId, { Offset offset: Offset.zero, double width: 0.0, double height: 0.0}) { assert(offset != null, 'Offset argument was null'); _addPlatformView(offset.dx, offset.dy, width, height, viewId); From c0fd1f0859d4b258dd90199c5e8c53249ed9bdd3 Mon Sep 17 00:00:00 2001 From: Amir Hardon Date: Tue, 27 Nov 2018 09:33:02 -0800 Subject: [PATCH 2/2] fix typos --- lib/ui/compositing.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ui/compositing.dart b/lib/ui/compositing.dart index 50af0e068f785..89529c093fda9 100644 --- a/lib/ui/compositing.dart +++ b/lib/ui/compositing.dart @@ -276,7 +276,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 { /// /// Only supported on iOS, this is currently a no-op on other platforms. /// - /// On iOS this layer splits the current output surface into 2 surfaces, one for the scene nodes + /// On iOS this layer splits the current output surface into two surfaces, one for the scene nodes /// preceding the platform view, and one for the scene nodes following the platform view. /// /// ## Performance impact @@ -284,8 +284,8 @@ class SceneBuilder extends NativeFieldWrapperClass2 { /// Adding an additional surface doubles the amount of graphics memory directly used by Flutter /// for output buffers. Quartz might allocated extra buffers for compositing the Flutter surfaces /// and the platform view. - /// - /// With a platform view in the scene, Quarts has to composite the 2 Flutter surfaces and the + /// + /// With a platform view in the scene, Quartz has to composite the two Flutter surfaces and the /// embedded UIView. In addition to that, on iOS versions greater than 9, the Flutter frames are /// synchronized with the UIView frames adding additional performance overhead. void addPlatformView(int viewId, { Offset offset: Offset.zero, double width: 0.0, double height: 0.0}) {