From 18e06c37e10943f4b4f6d57b7044b9bce3a23202 Mon Sep 17 00:00:00 2001 From: Alexandra Cherdantseva Date: Mon, 30 Dec 2019 14:40:03 +0300 Subject: wasm: do not get canvas as property of js global object You cannot be sure that property with specified key in a global object is really a canvas. Should use `document.getElementById`. Change-Id: Ife55adaad5517aed64122b0c9bff32489cf19a2f Reviewed-by: Lorn Potter --- src/plugins/platforms/wasm/qwasmopenglcontext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/wasm/qwasmopenglcontext.cpp') diff --git a/src/plugins/platforms/wasm/qwasmopenglcontext.cpp b/src/plugins/platforms/wasm/qwasmopenglcontext.cpp index 0532b7e726..501ab99116 100644 --- a/src/plugins/platforms/wasm/qwasmopenglcontext.cpp +++ b/src/plugins/platforms/wasm/qwasmopenglcontext.cpp @@ -106,7 +106,7 @@ EMSCRIPTEN_WEBGL_CONTEXT_HANDLE QWasmOpenGLContext::createEmscriptenContext(cons attributes.depth = useDepthStencil; attributes.stencil = useDepthStencil; - EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = emscripten_webgl_create_context(canvasId.toLocal8Bit().constData(), &attributes); + EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = emscripten_webgl_create_context(canvasId.toUtf8().constData(), &attributes); return context; } -- cgit v1.2.3