MCPcopy
hub / github.com/phaserjs/phaser / IsSizePowerOfTwo

Function IsSizePowerOfTwo

src/math/pow2/IsSizePowerOfTwo.js:19–22  ·  view source on GitHub ↗
(width, height)

Source from the content-addressed store, hash-verified

17 * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`.
18 */
19var IsSizePowerOfTwo = function (width, height)
20{
21 return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0);
22};
23
24module.exports = IsSizePowerOfTwo;

Callers 8

WebGLRenderer.jsFile · 0.85
DrawingContext.jsFile · 0.85
TextureSource.jsFile · 0.85
CanvasTexture.jsFile · 0.85
verifyCompressedTextureFunction · 0.85
checkPVRTCFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…