Repository: flutter
Issue: [android][platform_view] significant stuttering when swiping a page that contains platform views
Labels: platform-android,a: platform-views,P2,platform-views: tlhc,team-android,triaged-android

https://user-images.githubusercontent.com/26625149/236459986-ae88d547-9bd8-4853-9c7f-81d6edfa12a2.mp4

(By the way, when entering the page for the first time in the video, the appearance of a black block in the platform view area [is another issue](https://github.com/flutter/flutter/issues/121686).)

### Steps to reproduce

1. Get sample code: `git clone git@github.com:0xZOne/platform_view_performance.git`
2. Execute `flutter run`
3. As shown in the video

### Perfetto trace
[trace_file.perfetto-trace.zip](https://github.com/flutter/flutter/files/11411858/trace_file.perfetto-trace.zip)


<details><summary>Codes</summary>

```java
public class MainActivity extends FlutterActivity {
    @Override
    public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
        flutterEngine
            .getPlatformViewsController()
            .getRegistry()
            .registerViewFactory("<simple-text-view>", new NativeViewFactory());
    }

    @Override
    public RenderMode getRenderMode() {
        // return RenderMode.surface;
        return RenderMode.texture;
    }
}
```
</details>


<details><summary>Logs</summary>

```console
E/FrameEvents(11057): updateAcquireFence: Did not find frame.
E/FrameEvents(11057): updateAcquireFence: Did not find frame.
E/FrameEvents(11057): updateAcquireFence: Did not find frame.
E/FrameEvents(11057): updateAcquireFence: Did not find frame.
E/FrameEvents(11057): updateAcquireFence: Did not find frame.
E/FrameEvents(11057): updateAcquireFence: Did not find frame.
E/FrameEvents(11057): updateAcquireFence: Did not find frame.
E/FrameEvents(11057): updateAcquireFence: Did not find frame.
```

</details>



<details><summary>flutter doctor -v</summary>

```console
[✓] Flutter (Channel main, 3.11.0-1.0.pre.66, on macOS 13.1 22C65 darwin-x64, locale zh-Hans-CN)
    • Flutter version 3.11.0-1.0.pre.66 on channel main at /Users/zero/fvm/versions/main
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 59c1ac4103 (5 hours ago), 2023-05-05 03:55:09 -0400
    • Engine revision e7cd29153a
    • Dart version 3.1.0 (build 3.1.0-77.0.dev)
    • DevTools version 2.23.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/zero/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • ANDROID_SDK_ROOT = /Users/zero/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.76.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.62.0

[✓] Connected device (3 available)
    • Pixel 6 (mobile) • 19291FDF6001GN • android-arm64  • Android 13 (API 33)
    • macOS (desktop)  • macos          • darwin-x64     • macOS 13.1 22C65 darwin-x64
    • Chrome (web)     • chrome         • web-javascript • Google Chrome 112.0.5615.137

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>