From d387d0fe3b750ced0832eaed4d04338e6d8beb97 Mon Sep 17 00:00:00 2001 From: Jackson Gardner Date: Thu, 7 Nov 2024 10:34:08 -0800 Subject: [PATCH] [skwasm] Make sure to include the transfer list when using postMessage. (flutter/engine#56431) This change doesn't have unit tests, because it doesn't actually change the functional behavior of the renderer, it only changes its performance characteristics. If the transfer list is not included, the browser copies the image bitmaps instead of transfers them, which is slow, but does actually work. I am going to be adding some additional benchmarking in the framework to ensure that we detect if we regress something like this again. --- .../flutter/lib/web_ui/skwasm/library_skwasm_multi_threaded.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/lib/web_ui/skwasm/library_skwasm_multi_threaded.js b/engine/src/flutter/lib/web_ui/skwasm/library_skwasm_multi_threaded.js index 0070adaf84b..237ccf38bed 100644 --- a/engine/src/flutter/lib/web_ui/skwasm/library_skwasm_multi_threaded.js +++ b/engine/src/flutter/lib/web_ui/skwasm/library_skwasm_multi_threaded.js @@ -43,7 +43,7 @@ mergeInto(LibraryManager.library, { if (threadId) { PThread.pthreads[threadId].postMessage(message, transfers); } else { - postMessage(message); + postMessage(message, transfers); } }; },