Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/dev/core/src/Misc/dumpTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class DumpTools {

private static _CreateDumpRenderer(): DumpToolsEngine {
if (!DumpTools._DumpToolsEngine) {
let canvas: HTMLCanvasElement | OffscreenCanvas = new OffscreenCanvas(100, 100); // will be resized later
let canvas: HTMLCanvasElement | OffscreenCanvas;
let engine: Nullable<ThinEngine> = null;
const options = {
preserveDrawingBuffer: true,
Expand All @@ -38,9 +38,10 @@ export class DumpTools {
failIfMajorPerformanceCaveat: false,
};
try {
canvas = new OffscreenCanvas(100, 100); // will be resized later
engine = new ThinEngine(canvas, false, options);
} catch (e) {
// The browser does not support WebGL context in OffscreenCanvas, fallback on a regular canvas
// The browser either does not support OffscreenCanvas or WebGL context in OffscreenCanvas, fallback on a regular canvas
canvas = document.createElement("canvas");
engine = new ThinEngine(canvas, false, options);
}
Expand Down