未验证 提交 44582b12 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #14483 from cherniavskii/patch-1

WebGLTextures: Avoid memory leaks when logging warnings
......@@ -35,7 +35,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
var context = canvas.getContext( '2d' );
context.drawImage( image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height );
console.warn( 'THREE.WebGLRenderer: image is too big (' + image.width + 'x' + image.height + '). Resized to ' + canvas.width + 'x' + canvas.height, image );
console.warn( 'THREE.WebGLRenderer: image is too big (' + image.width + 'x' + image.height + '). Resized to ' + canvas.width + 'x' + canvas.height );
return canvas;
......@@ -63,7 +63,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
var context = _canvas.getContext( '2d' );
context.drawImage( image, 0, 0, _canvas.width, _canvas.height );
console.warn( 'THREE.WebGLRenderer: image is not power of two (' + image.width + 'x' + image.height + '). Resized to ' + _canvas.width + 'x' + _canvas.height, image );
console.warn( 'THREE.WebGLRenderer: image is not power of two (' + image.width + 'x' + image.height + '). Resized to ' + _canvas.width + 'x' + _canvas.height );
return _canvas;
......@@ -253,11 +253,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
if ( image === undefined ) {
console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is undefined', texture );
console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is undefined' );
} else if ( image.complete === false ) {
console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete', texture );
console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete' );
} else {
......@@ -427,7 +427,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
if ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) {
console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.', texture );
console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.' );
}
......@@ -436,7 +436,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
if ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) {
console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.', texture );
console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.' );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册