|
|
@@ -497,25 +497,6 @@ class WebGLTextureUtils {
|
|
|
if ( texture.isRenderTargetTexture || ( textureGPU === undefined /* unsupported texture format */ ) )
|
|
|
return;
|
|
|
|
|
|
- const getImage = ( source ) => {
|
|
|
-
|
|
|
- if ( source.isDataTexture ) {
|
|
|
-
|
|
|
- return source.image.data;
|
|
|
-
|
|
|
- } else if ( ( typeof HTMLImageElement !== 'undefined' && source instanceof HTMLImageElement ) ||
|
|
|
- ( typeof HTMLCanvasElement !== 'undefined' && source instanceof HTMLCanvasElement ) ||
|
|
|
- ( typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap ) ||
|
|
|
- ( typeof OffscreenCanvas !== 'undefined' && source instanceof OffscreenCanvas ) ) {
|
|
|
-
|
|
|
- return source;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return source.data;
|
|
|
-
|
|
|
- };
|
|
|
-
|
|
|
this.backend.state.bindTexture( glTextureType, textureGPU );
|
|
|
|
|
|
this.setTextureParameters( glTextureType, texture );
|
|
|
@@ -1154,4 +1135,23 @@ class WebGLTextureUtils {
|
|
|
|
|
|
}
|
|
|
|
|
|
+function getImage( source ) {
|
|
|
+
|
|
|
+ if ( source.isDataTexture ) {
|
|
|
+
|
|
|
+ return source.image.data;
|
|
|
+
|
|
|
+ } else if ( ( typeof HTMLImageElement !== 'undefined' && source instanceof HTMLImageElement ) ||
|
|
|
+ ( typeof HTMLCanvasElement !== 'undefined' && source instanceof HTMLCanvasElement ) ||
|
|
|
+ ( typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap ) ||
|
|
|
+ ( typeof OffscreenCanvas !== 'undefined' && source instanceof OffscreenCanvas ) ) {
|
|
|
+
|
|
|
+ return source;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return source.data;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
export default WebGLTextureUtils;
|