Internal change
PiperOrigin-RevId: 490595529
This commit is contained in:
parent
bfa57310c4
commit
41a7f9d7d6
|
@ -176,10 +176,14 @@ export class GraphRunner {
|
|||
|
||||
if (glCanvas !== undefined) {
|
||||
this.wasmModule.canvas = glCanvas;
|
||||
} else {
|
||||
} else if (typeof OffscreenCanvas !== 'undefined') {
|
||||
// If no canvas is provided, assume Chrome/Firefox and just make an
|
||||
// OffscreenCanvas for GPU processing.
|
||||
this.wasmModule.canvas = new OffscreenCanvas(1, 1);
|
||||
} else {
|
||||
console.warn('OffscreenCanvas not detected and GraphRunner constructor '
|
||||
+ 'glCanvas parameter is undefined. Creating backup canvas.');
|
||||
this.wasmModule.canvas = document.createElement('canvas');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user