From fd19fc1c6810c1e79d930d6564e13bc62c858c73 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Fri, 21 Jun 2024 11:18:05 +0800 Subject: [PATCH] fix: use preserveDrawingBuffer=true on web using createImageFromImageBitmap to import the canvas directly into a Flutter app results in flickering unless this is set to true (as the drawing buffer is otherwise cleared after each render, which may not line up with Flutter's ticker --- thermion_dart/native/web/src/cpp/ThermionDartWebApi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thermion_dart/native/web/src/cpp/ThermionDartWebApi.cpp b/thermion_dart/native/web/src/cpp/ThermionDartWebApi.cpp index a55270ca..0c441841 100644 --- a/thermion_dart/native/web/src/cpp/ThermionDartWebApi.cpp +++ b/thermion_dart/native/web/src/cpp/ThermionDartWebApi.cpp @@ -125,7 +125,7 @@ extern "C" attr.stencil = EM_FALSE; attr.antialias = EM_FALSE; attr.explicitSwapControl = EM_FALSE; - attr.preserveDrawingBuffer = EM_FALSE; + attr.preserveDrawingBuffer = EM_TRUE; attr.proxyContextToMainThread = EMSCRIPTEN_WEBGL_CONTEXT_PROXY_DISALLOW; attr.enableExtensionsByDefault = EM_TRUE; attr.renderViaOffscreenBackBuffer = EM_FALSE;