Просмотр исходного кода

WebGPURenderer: Fix OffscreenCanvas Support in WebGL (#29867)

Renaud Rohlinger 1 год назад
Родитель
Сommit
901c516933
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      src/renderers/webgl-fallback/utils/WebGLTextureUtils.js

+ 4 - 1
src/renderers/webgl-fallback/utils/WebGLTextureUtils.js

@@ -415,7 +415,10 @@ class WebGLTextureUtils {
 
 
 				return source.image.data;
 				return source.image.data;
 
 
-			} else if ( source instanceof ImageBitmap || source instanceof OffscreenCanvas || source instanceof HTMLImageElement || source instanceof HTMLCanvasElement ) {
+			} else if ( ( typeof HTMLImageElement !== 'undefined' && source instanceof HTMLImageElement ) ||
+				( typeof HTMLCanvasElement !== 'undefined' && source instanceof HTMLCanvasElement ) ||
+				( typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap ) ||
+				source instanceof OffscreenCanvas ) {
 
 
 				return source;
 				return source;
 
 

粤ICP备19079148号