wasm: provide isValid implementation for QWasmOffscreenSurface

Fixes: QTBUG-120350
Pick-to: 6.6
Change-Id: I0cb2ba66a2d27f3d96a4a6a1cb85695f6b305178
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 139d57a7e906b84672024661a58628918ceff928)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Lorn Potter 2023-12-22 17:36:41 +10:00 committed by Qt Cherry-pick Bot
parent df753ab453
commit 417cf07c5d
2 changed files with 6 additions and 0 deletions

View File

@ -27,4 +27,9 @@ QWasmOffscreenSurface::~QWasmOffscreenSurface()
emscripten::val::module_property("specialHTMLTargets").delete_(m_specialTargetId);
}
bool QWasmOffscreenSurface::isValid() const
{
return !m_offscreenCanvas.isNull() && !m_offscreenCanvas.isUndefined();
}
QT_END_NAMESPACE

View File

@ -20,6 +20,7 @@ public:
~QWasmOffscreenSurface() final;
const std::string &id() const { return m_specialTargetId; }
bool isValid() const override;
private:
std::string m_specialTargetId;