Skip to content

Commit 7f94c80

Browse files
DesplandisBOUILLAGUET Quentin
andauthored
Remove conditional import for TextureUtils (#1335)
Co-authored-by: BOUILLAGUET Quentin <quentin.bouillaguet@ign.fr>
1 parent 9bdf5ce commit 7f94c80

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

src/three/plugins/images/sources/TiledImageSource.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { DataCache } from '../utils/DataCache.js';
22
import { TilingScheme } from '../utils/TilingScheme.js';
3-
import { SRGBColorSpace, Texture } from 'three';
4-
import * as THREE from 'three';
3+
import { SRGBColorSpace, Texture, TextureUtils } from 'three';
54

65
// TODO: support queries for detail at level - ie projected pixel size for geometric error mapping
76
// Goes here or in "TilingScheme"?
@@ -39,14 +38,6 @@ export class TiledImageSource extends DataCache {
3938

4039
getMemoryUsage( tex ) {
4140

42-
// deprecated: remove in next major release
43-
const { TextureUtils } = THREE;
44-
if ( ! TextureUtils ) {
45-
46-
return 0;
47-
48-
}
49-
5041
const { format, type, image, generateMipmaps } = tex;
5142
const { width, height } = image;
5243
const bytes = TextureUtils.getByteLength( width, height, format, type );

src/three/renderer/utils/MemoryUtils.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
import { estimateBytesUsed as _estimateBytesUsed } from 'three/examples/jsm/utils/BufferGeometryUtils.js';
2-
import * as THREE from 'three';
2+
import { TextureUtils } from 'three';
33

44
export function safeTextureGetByteLength( tex ) {
55

6-
// NOTE: This is for backwards compatibility and should be removed later
7-
// deprecated: remove in next major release
8-
const { TextureUtils } = THREE;
9-
if ( ! TextureUtils || ! tex ) {
10-
11-
return 0;
12-
13-
}
14-
156
const { format, type, image } = tex;
167
const { width, height } = image;
178

0 commit comments

Comments
 (0)