From 04d3aee2e9f248f3d4070d173bdb3e16bf8b2133 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Thu, 8 May 2025 17:25:54 +0800 Subject: [PATCH] don't actually invoke markTextureFrameAvailable on Android (the swapchain is attached to the window so this is not necessary --- .../src/thermion_flutter_method_channel_platform.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/thermion_flutter/thermion_flutter_method_channel/lib/src/thermion_flutter_method_channel_platform.dart b/thermion_flutter/thermion_flutter_method_channel/lib/src/thermion_flutter_method_channel_platform.dart index 5ee79ba5..b2681cd7 100644 --- a/thermion_flutter/thermion_flutter_method_channel/lib/src/thermion_flutter_method_channel_platform.dart +++ b/thermion_flutter/thermion_flutter_method_channel/lib/src/thermion_flutter_method_channel_platform.dart @@ -168,8 +168,8 @@ class ThermionFlutterMethodChannelPlatform extends ThermionFlutterPlatform { await FilamentApp.instance!.unregister(_swapChain!, view); await FilamentApp.instance!.destroySwapChain(_swapChain!); } - _swapChain = - await FilamentApp.instance!.createSwapChain(descriptor.windowHandle!); + _swapChain = await FilamentApp.instance! + .createSwapChain(Pointer.fromAddress(descriptor.windowHandle!)); await FilamentApp.instance!.register(_swapChain!, view); } else { final color = await FilamentApp.instance! @@ -204,8 +204,10 @@ class ThermionFlutterMethodChannelPlatform extends ThermionFlutterPlatform { @override Future markTextureFrameAvailable(PlatformTextureDescriptor texture) async { - await channel.invokeMethod( - "markTextureFrameAvailable", texture.flutterTextureId); + if (!Platform.isAndroid) { + await channel.invokeMethod( + "markTextureFrameAvailable", texture.flutterTextureId); + } } @override