Skip to content

Commit cfd19db

Browse files
committed
clarify that b Must be 0 (as per WebGL standard) and remove unnecassry || statement
1 parent 35f297e commit cfd19db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/video/webgl/compositors/quad_compositor.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ var V_ARRAY = [
7676
* @param {string} [repeat="no-repeat"] - Image repeat behavior (see {@link ImageLayer#repeat})
7777
* @param {number} [w=image.width] - Source image width (Only use with UInt8Array[] or Float32Array[] source image)
7878
* @param {number} [h=image.height] - Source image height (Only use with UInt8Array[] or Float32Array[] source image)
79-
* @param {number} [b=0] - Source image border (Only use with UInt8Array[] or Float32Array[] source image)
79+
* @param {number} [b=0] - Source image border width. Must be 0.
8080
* @param {boolean} [premultipliedAlpha=true] - Multiplies the alpha channel into the other color channels
8181
* @param {boolean} [mipmap=true] - Whether mipmap levels should be generated for this texture
8282
* @returns {WebGLTexture} a WebGL texture
8383
*/
8484
createTexture2D(unit, image, filter, repeat = "no-repeat", w = image.width, h = image.height, b = 0, premultipliedAlpha = true, mipmap = true) {
8585
var gl = this.gl;
86-
var isPOT = isPowerOfTwo(w || image.width) && isPowerOfTwo(h || image.height);
86+
var isPOT = isPowerOfTwo(w) && isPowerOfTwo(h);
8787
var texture = gl.createTexture();
8888
var rs = (repeat.search(/^repeat(-x)?$/) === 0) && (isPOT || this.renderer.WebGLVersion > 1) ? gl.REPEAT : gl.CLAMP_TO_EDGE;
8989
var rt = (repeat.search(/^repeat(-y)?$/) === 0) && (isPOT || this.renderer.WebGLVersion > 1) ? gl.REPEAT : gl.CLAMP_TO_EDGE;

0 commit comments

Comments
 (0)