Repository: flutter
Issue: [Android] Only One Start Frame from Android TextureView Doesn't Copied to Flutter Platform View(TLHC)
Labels: platform-android,c: performance,has reproducible steps,P2,platform-views: tlhc,team-android,triaged-android,found in release: 3.19,found in release: 3.20

related issue: https://github.com/note11g/flutter_naver_map/issues/195

### description

When utilizing methods like controller.addOverlay or controller.updateCamera, the copy isn't properly executed in the first frame where the sequence (continuous frames) starts due to the changes.

For the addOverlay method that adds an overlay, the overlay does not immediately appear on the map, and a separate frame must be forcibly created for it to appear correctly (Frame Copy Failed).

In the case of methods like controller.updateCamera that start moving the camera, the starting frames appear to be interrupted (jank).

I have yet to find a solution to these problems.

I tried two methods,

1. setState(): As expected, it doesn't redraw the frame when called with no changes in the widget state, so it has no effect.
2. SchedulerBinding.instance.scheduleForcedFrame(): I tried to forcibly render the frame, but it seems to be considered that the platform view has already processed the frame.

### Steps to reproduce

**Environment: TLHC + TextureView**
_(In flutter_naver_map, using that combination in **SDK 23\~29, SDK 33\~34.** 
30~32: TLHC+GLSurfaceView, this issue not produced)_

Produced with SDK 23\~29, 33\~34  android emulator, Samsung Galaxy S23 Ultra(SDK 34)
Flutter 3.19.0(Stable), 3.19.1(Stable), 3.19.2(Stable), Flutter 3.20.0-16.0.pre.54(Main Channel)

(Not Produced at HC or GLSurfaceView)

all modes can be re-produced : debug mode, profile mode, release mode

Using This Sample Repository: https://github.com/note11g/flutter_naver_map_pure_example/tree/tlhc_copy_issue
(if you want test on flutter sdk main channel, please use `flutter_naver_map: git: url: https://github.com/note11g/flutter_naver_map.git ref: migrate_3.20`)

1. turn on app 
2. tab FloatingActionButton. then, `addMarker` method will be launched.
3. see the result and scroll the map view.

### Expected results

successfully shown the new overlay attaching.

(on iOS)
https://github.com/note11g/flutter_naver_map/assets/67783062/6109e6f5-fc51-4aba-ac9b-96fea497af1f


### Actual results

maybe it's frame copy failed. overlay attaching not shown immediately.

(Android 14, TLHC+TextureView)
https://github.com/note11g/flutter_naver_map/assets/67783062/2b081f0b-bfbd-4a6d-abc8-4e0dfaa136ab


### Code sample

on this repository:
https://github.com/note11g/flutter_naver_map_pure_example/tree/tlhc_copy_issue

if you want internal codes, show this file: 
https://github.com/note11g/flutter_naver_map/blob/dev-1.2.2/lib/src/widget/platform_view.dart

### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

### Issue (Android 14)
https://github.com/note11g/flutter_naver_map/assets/67783062/2b081f0b-bfbd-4a6d-abc8-4e0dfaa136ab

### Non-Issue (iOS)
https://github.com/note11g/flutter_naver_map/assets/67783062/6109e6f5-fc51-4aba-ac9b-96fea497af1f
</details>


### Logs

<details open><summary>Logs</summary>

```console
[NaverMapSdk] SDK Initialized! (android, SDK 33)
I/PlatformViewsController(15894): Hosting view in view hierarchy for platform view: 0
I/PlatformViewsController(15894): PlatformView is using ImageReader backend
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
W/Parcel  (15894): Expecting binder but got null!
D/EGL_emulation(15894): app_time_stats: avg=105529.19ms min=12.30ms max=633095.62ms count=6
D/HostConnection(15894): createUnique: call
D/HostConnection(15894): HostConnection::get() New Host Connection established 0xb40000773e4d81d0, tid 16446
D/HostConnection(15894): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_vulkan_async_qsri GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
D/EGL_emulation(15894): eglCreateContext: 0xb40000773e4d93d0: maj 3 min 0 rcv 3
D/EGL_emulation(15894): eglMakeCurrent: 0xb40000773e4d93d0: ver 3 0 (tinfo 0x79651d1280) (first time)
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/ImageTextureRegistryEntry(15894): Dropping PlatformView Frame
D/EGL_emulation(15894): app_time_stats: avg=506.45ms min=62.32ms max=950.58ms count=2
D/TrafficStats(15894): tagSocket(437) with statsTag=0xffffffff, statsUid=-1
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/ImageTextureRegistryEntry(15894): Dropping PlatformView Frame
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/ImageTextureRegistryEntry(15894): Dropping PlatformView Frame
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/ImageTextureRegistryEntry(15894): Dropping PlatformView Frame
D/EGL_emulation(15894): app_time_stats: avg=35.70ms min=13.41ms max=114.73ms count=28
D/EGL_emulation(15894): app_time_stats: avg=14.32ms min=0.85ms max=186.05ms count=75
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
D/EGL_emulation(15894): app_time_stats: avg=38.09ms min=13.75ms max=183.25ms count=30
D/EGL_emulation(15894): app_time_stats: avg=37.29ms min=14.42ms max=183.44ms count=29
D/EGL_emulation(15894): app_time_stats: avg=65.31ms min=5.98ms max=735.52ms count=17
D/EGL_emulation(15894): app_time_stats: avg=1008.57ms min=1008.57ms max=1008.57ms count=1
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
D/EGL_emulation(15894): app_time_stats: avg=1015.25ms min=1015.25ms max=1015.25ms count=1
D/EGL_emulation(15894): app_time_stats: avg=1015.28ms min=1015.28ms max=1015.28ms count=1
D/EGL_emulation(15894): app_time_stats: avg=795.71ms min=8.55ms max=11713.45ms count=15
D/EGL_emulation(15894): app_time_stats: avg=11924.84ms min=11924.84ms max=11924.84ms count=1
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
D/EGL_emulation(15894): app_time_stats: avg=11918.29ms min=11918.29ms max=11918.29ms count=1
D/EGL_emulation(15894): app_time_stats: avg=11918.89ms min=11918.89ms max=11918.89ms count=1
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
D/EGL_emulation(15894): app_time_stats: avg=9824.10ms min=9824.10ms max=9824.10ms count=1
D/EGL_emulation(15894): app_time_stats: avg=9844.43ms min=9844.43ms max=9844.43ms count=1
D/EGL_emulation(15894): app_time_stats: avg=9832.04ms min=9832.04ms max=9832.04ms count=1
D/EGL_emulation(15894): app_time_stats: avg=821.64ms min=11.43ms max=9689.68ms count=12
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
D/EGL_emulation(15894): app_time_stats: avg=190.02ms min=9.98ms max=5078.30ms count=29
D/EGL_emulation(15894): app_time_stats: avg=64.44ms min=2.80ms max=5103.51ms count=86
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
D/EGL_emulation(15894): app_time_stats: avg=192.21ms min=12.18ms max=5116.44ms count=29
D/EGL_emulation(15894): app_time_stats: avg=180.84ms min=3.61ms max=5106.51ms count=29
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
D/EGL_emulation(15894): app_time_stats: avg=3726.57ms min=3726.57ms max=3726.57ms count=1
D/EGL_emulation(15894): app_time_stats: avg=3750.95ms min=3750.95ms max=3750.95ms count=1
D/EGL_emulation(15894): app_time_stats: avg=3730.44ms min=3730.44ms max=3730.44ms count=1
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/ImageTextureRegistryEntry(15894): Dropping PlatformView Frame
D/EGL_emulation(15894): app_time_stats: avg=269.19ms min=5.21ms max=3567.93ms count=14
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
E/FrameEvents(15894): updateAcquireFence: Did not find frame.
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.2, on macOS 14.3.1 23D60 darwin-arm64, locale ko-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] IntelliJ IDEA Community Edition (version 2023.3.3)
[✓] VS Code (version 1.87.0)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!
```

</details>