Skip to content

Commit a2e1493

Browse files
authored
Merge pull request #15900 from Mugen87/dev27
WebGLTextures: Make resizeImage() more robust.
2 parents 4e1c1a0 + 2604380 commit a2e1493

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/renderers/webgl/WebGLTextures.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
4242

4343
// only perform resize for certain image types
4444

45-
if ( image instanceof ImageBitmap || image instanceof HTMLImageElement || image instanceof HTMLCanvasElement ) {
45+
if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||
46+
( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||
47+
( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {
4648

4749
var floor = needsPowerOfTwo ? _Math.floorPowerOfTwo : Math.floor;
4850

0 commit comments

Comments
 (0)