Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/ui/compositing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,6 @@ class SceneBuilder extends NativeFieldWrapperClass2 {

/// Adds a platform view (e.g an iOS UIView) to the scene.
///
/// Only supported on iOS, this is currently a no-op on other platforms.
///
/// 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.
///
Expand All @@ -729,6 +727,8 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
/// 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.
///
/// The `offset` argument is not used for iOS and Android.
void addPlatformView(
int viewId, {
Offset offset = Offset.zero,
Expand Down
15 changes: 4 additions & 11 deletions testing/scenario_app/lib/src/platform_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -707,21 +707,15 @@ mixin _BasePlatformViewScenarioMixin on Scenario {
SceneBuilder sceneBuilder,
int viewId,
double width,
double height, {
Offset overlayOffset,
}) {
overlayOffset ??= const Offset(50, 50);
double height,
) {
if (Platform.isIOS) {
sceneBuilder.addPlatformView(viewId, offset: overlayOffset, width: width, height: height);
sceneBuilder.addPlatformView(viewId, width: width, height: height);
} else if (Platform.isAndroid) {
if (usesAndroidHybridComposition) {
// Hybrid composition does not support `offset`.
// https://github.com/flutter/flutter/issues/60630
sceneBuilder.pushOffset(overlayOffset.dx, overlayOffset.dy);
sceneBuilder.addPlatformView(viewId, width: width, height: height);
sceneBuilder.pop();
} else if (_textureId != null) {
sceneBuilder.addTexture(_textureId, offset: overlayOffset, width: width, height: height);
sceneBuilder.addTexture(_textureId, width: width, height: height);
}
} else {
throw UnsupportedError('Platform ${Platform.operatingSystem} is not supported');
Expand All @@ -740,7 +734,6 @@ mixin _BasePlatformViewScenarioMixin on Scenario {
viewId,
500,
500,
overlayOffset: overlayOffset,
);
final PictureRecorder recorder = PictureRecorder();
final Canvas canvas = Canvas(recorder);
Expand Down