From 0eea2238f37a5eaa83ada6cd262eceaed20e415c Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Mon, 28 Nov 2022 16:35:24 +0100 Subject: Quasi-support for offscreen surface on WASM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since context sharing is not currently supported with WebGL, offscreen contexts have a limited usability on Qt for WASM. If a context is shared, use the same underlaying WebGL context so that the two can actually share resources. This is not full-blown context sharing by any means but it makes e.g. the Open GL widget work as the readback texture for it is 'shared' between the virtual Qt contexts. If no sharing is desired, we use an OffscreenCanvas and actually create a separate WebGL context. Fixes: QTBUG-107558 Pick-to: 6.5 Change-Id: If57e44739ddb57c167d5f8881a74d8dee52531f6 Reviewed-by: MikoĊ‚aj Boc --- src/plugins/platforms/wasm/qwasmintegration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/wasm/qwasmintegration.cpp') diff --git a/src/plugins/platforms/wasm/qwasmintegration.cpp b/src/plugins/platforms/wasm/qwasmintegration.cpp index b92e456668..9f139ad446 100644 --- a/src/plugins/platforms/wasm/qwasmintegration.cpp +++ b/src/plugins/platforms/wasm/qwasmintegration.cpp @@ -184,7 +184,7 @@ void QWasmIntegration::removeBackingStore(QWindow* window) #ifndef QT_NO_OPENGL QPlatformOpenGLContext *QWasmIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const { - return new QWasmOpenGLContext(context->format()); + return new QWasmOpenGLContext(context); } #endif -- cgit v1.2.3