From 0a4c5b5119ccefc355fe737f03ec330e70c33ec9 Mon Sep 17 00:00:00 2001 From: Alexandra Cherdantseva Date: Fri, 17 Jan 2020 12:32:27 +0300 Subject: wasm: fix redundant string conversions between wasm and JavaScript MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid redundant conversions from UTF16 to UTF8 to UTF16 with help of new class QWasmString static methods: + QWasmString::fromQString to convert QString to js string using js Module.UTF16ToString + QWasmString::toQString to convert js string to QString using js Module.stringToUTF16 Fixed document.getElementById calls for cavasId with unicode characters. Change-Id: I3fc55bfeb6aeda75fa3acd85d22cea667b542f38 Reviewed-by: Morten Johan Sørvig Reviewed-by: Lorn Potter --- mkspecs/wasm-emscripten/qmake.conf | 1 + 1 file changed, 1 insertion(+) (limited to 'mkspecs/wasm-emscripten') diff --git a/mkspecs/wasm-emscripten/qmake.conf b/mkspecs/wasm-emscripten/qmake.conf index 48c3fb7359..f4e9501415 100644 --- a/mkspecs/wasm-emscripten/qmake.conf +++ b/mkspecs/wasm-emscripten/qmake.conf @@ -35,6 +35,7 @@ EMCC_COMMON_LFLAGS += \ -s USE_WEBGL2=1 \ -s NO_EXIT_RUNTIME=0 \ -s ERROR_ON_UNDEFINED_SYMBOLS=1 \ + -s EXTRA_EXPORTED_RUNTIME_METHODS=[\"UTF16ToString\",\"stringToUTF16\"] \ --bind # The -s arguments can also be used with release builds, -- cgit v1.2.3