From de4fd3b8d066c0007c94efe0f1849bcc17fcab68 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Wed, 23 Oct 2024 02:24:49 +1100 Subject: [PATCH] feat: (flutter) (windows) add DestroyRenderingSurface method --- .../windows/flutter_render_context.h | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/thermion_flutter/thermion_flutter/windows/flutter_render_context.h b/thermion_flutter/thermion_flutter/windows/flutter_render_context.h index c582d349..de2d4df0 100644 --- a/thermion_flutter/thermion_flutter/windows/flutter_render_context.h +++ b/thermion_flutter/thermion_flutter/windows/flutter_render_context.h @@ -13,26 +13,10 @@ namespace thermion_flutter { class FlutterRenderContext { public: - void CreateRenderingSurface(uint32_t width, uint32_t height, std::unique_ptr> result, uint32_t left, uint32_t top ); + void CreateRenderingSurface(uint32_t width, uint32_t height, std::unique_ptr> result, uint32_t left, uint32_t top); - void DestroyTexture(std::unique_ptr> result) { - if (!_active) { - result->Success("Texture has already been detroyed, ignoring"); - return; - } - - auto sh = std::make_shared< - std::unique_ptr>>( - std::move(result)); - - _textureRegistrar->UnregisterTexture( - _active->flutterTextureId, [=, sharedResult = std::move(sh)]() { - this->_inactive = std::move(this->_active); - auto unique = std::move(*(sharedResult.get())); - unique->Success(flutter::EncodableValue(true)); - std::cout << "Unregistered/destroyed texture." << std::endl; - }); - } + void DestroyRenderingSurface(std::unique_ptr> result); + int64_t GetFlutterTextureId() { if(!_active) { return -1;