summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmscreen.cpp
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2019-01-30 18:17:39 +1000
committerLorn Potter <lorn.potter@gmail.com>2019-02-13 04:12:53 +0000
commit960af0d64de576321db91ccbe426891465b24540 (patch)
tree3567d0182f7209423ec682bd910e4d480d02a5ae /src/plugins/platforms/wasm/qwasmscreen.cpp
parent078cc302cb4f03ffdcee3696338385c33427c716 (diff)
wasm: remove EM_ASM calls in wasm platform plugin
Change-Id: I8453836b6730d18eaaa4ffe1fb9cb3933079ebee Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmscreen.cpp')
-rw-r--r--src/plugins/platforms/wasm/qwasmscreen.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/platforms/wasm/qwasmscreen.cpp b/src/plugins/platforms/wasm/qwasmscreen.cpp
index 93e9906ffc..37f1efadc6 100644
--- a/src/plugins/platforms/wasm/qwasmscreen.cpp
+++ b/src/plugins/platforms/wasm/qwasmscreen.cpp
@@ -30,6 +30,7 @@
#include "qwasmscreen.h"
#include "qwasmwindow.h"
#include "qwasmcompositor.h"
+#include <emscripten/bind.h>
#include <QtEglSupport/private/qeglconvenience_p.h>
#ifndef QT_NO_OPENGL
@@ -77,9 +78,7 @@ qreal QWasmScreen::devicePixelRatio() const
// HTML window dpr if the OpenGL driver/GPU allocates a less than
// full resolution surface. Use emscripten_webgl_get_drawing_buffer_size()
// and compute the dpr instead.
- double htmlWindowDpr = EM_ASM_DOUBLE({
- return window.devicePixelRatio;
- });
+ double htmlWindowDpr = emscripten::val::global("window")["devicePixelRatio"].as<double>();
return qreal(htmlWindowDpr);
}