wasm: provide isValid implementation for QWasmOffscreenSurface

Fixes: QTBUG-120350
Pick-to: 6.6 6.7
Change-Id: I0cb2ba66a2d27f3d96a4a6a1cb85695f6b305178
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
bb10
Lorn Potter 2023-12-22 17:36:41 +10:00
parent 9735b10558
commit 139d57a7e9
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;