summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmcompositor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* wasm: fix texture leak when window is destroyed in a different contextAlexandra Cherdantseva2020-02-271-2/+5
| | | | | | | | | | Reproduce: Show first window in first canvas; Show second window in second canvas; After screens are rendered destroy first window in first canvas Change-Id: Ifbeb4824c1fdedecf24d5d20e58613d15c066420 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: fix setting translucent backgroundLorn Potter2020-01-011-1/+1
| | | | | | | | | | We need to set the requested SurfaceFormat which may contain the alphaBufferSize in order for the GL context to have the alpha attribute Fixes: QTBUG-77303 Change-Id: I39860e24de49a255ab7e73bca78af92e6c074d0d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Eradicate Q_FOREACH in the WASM plugin and mark the plugin free of themMarc Mutz2019-07-151-2/+2
| | | | | | | | | | | | | | The first one is trivially correct: it clearly doesn't modify the container under iteration. The second is a bit more subtle, because drawWindow() could be expected to call a paintEvent and this could theoretically lead to lowering, closing, or opening of a window. But this function just ends up blit()ting, so it doesn't call into user code. Change-Id: Id15e0102e9c8aa12516af27d771104e9993c48a1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: controlled screen destructionMorten Johan Sørvig2019-05-141-2/+27
| | | | | | | | | | | | | Freeing OpenGL resources requires a current context, which (on wasm) requires a screen. Add a destroy() functions to QWasmScreen, QWasmCompositor, QWasmWindow, and QWasmBackingStore which facilitates OpenGL cleanup before we start deleting screen objects. Task-number: QTBUG-75463 Change-Id: I9954b536416b9147965c74459ccad838d1578778 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: use correct coordinates when blittingMorten Johan Sørvig2019-05-141-2/+3
| | | | | | | | | The target position is the position on the canvas, not the global position on the page. Task-number: QTBUG-75463 Change-Id: I4ea2c9afacd2065fa975f6fa2e6a93d98f637854 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: prevent crash on null backingstore pointerMorten Johan Sørvig2019-05-141-0/+2
| | | | | | | | | We can get draw calls in between creating the platform window and the platform backing store. Task-number: QTBUG-75463 Change-Id: If0b67d40fac84e466f204ec23a267aa4c6121cbd Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: improve event coordinate handlingMorten Johan Sørvig2019-04-041-2/+2
| | | | | | | | | | | | | | | targetX and targetY are canvas-local coordinates, while Qt generally works with window-local and global coordinates. Add coordinate mapping calls where needed and make sure we pass correct coordinate types to Qt. This starts mattering when we have canvases which are not located at (0, 0). Change-Id: I28563310ca17d0cc5535317cff99fcd82d3723db Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: support rendering to multiple canvasesMorten Johan Sørvig2019-03-081-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt (via the the qtloader.js API) now supports rendering to multiple canvases. The application sees each canvas as a QScreen. Make qtloader.js support multiple canvases: var qtloader = QtLoader({ canvasElements : [array-of-canvas], showCanvas: function() { // make canvas(es) visible }, }); The canvases were previously created/returned by showCanvas(), however this function is called after the Qt app has been started and adding screens that that point is too late. (This worked before since there was only one screen, and no need to connect each screen instance to specific canvas.) Remove QWasmScreen, QWasmCompositor, and QWasmEventTranslator singletons from QWasmIntegration. These are are now crated per-screen and are owned by the QWasmScreen. Task-number: QTBUG-64079 Change-Id: I24689929fd5bfb7ff0ba076f66937728fa4bc4e4 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: make maximized and fullscreen windows not draggableLorn Potter2018-09-281-1/+1
| | | | | | | | Also make fullscreen windows not have a titlebar Task-number: QTBUG-69318 Change-Id: I017fc40fecb9f46d6540ffb72a71c9b62097a368 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* WebAssembly for QtBaseMorten Johan Sørvig2018-08-301-0/+721
This is the squashed diff from wip/webassembly to dev. Done-with: Peng Wu <peng.wu@intopalo.com> Done-with: Sami Enne <sami.enne@intopalo.com> Done-with: Morten Johan Sørvig <morten.sorvig@qt.io> Started-by: Andrew Knight <andrew.knight@intopalo.com> Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>