design/gpu-programming/webgl/experiment/game-of-life/external/webgl-utils.js
function resizeCanvasToDisplaySize(canvas, multiplier) {
    multiplier = multiplier || 1;
    var width  = canvas.clientWidth  * multiplier | 0;
    var height = canvas.clientHeight * multiplier | 0;
    if (canvas.width !== width ||  canvas.height !== height) {
      canvas.width  = width;
      canvas.height = height;
      return true;
    }
    return false;
  }
function resizeCanvasToDisplaySize(canvas, multiplier) {
    multiplier = multiplier || 1;
    var width  = canvas.clientWidth  * multiplier | 0;
    var height = canvas.clientHeight * multiplier | 0;
    if (canvas.width !== width ||  canvas.height !== height) {
      canvas.width  = width;
      canvas.height = height;
      return true;
    }
    return false;
  }
function resizeCanvasToDisplaySize ( canvas , multiplier ) { multiplier = multiplier || 1 ; var width = canvas . clientWidth * multiplier | 0 ; var height = canvas . clientHeight * multiplier | 0 ; if ( canvas . width !== width || canvas . height !== height ) { canvas . width = width ; canvas . height = height ; return true ; } return false ; }
Resize a canvas to match the size its displayed.
@param {HTMLCanvasElement} canvas The canvas to resize.
@param {number} [multiplier] amount to multiply by.
Pass in window.devicePixelRatio for native pixels.
@return {boolean} true if the canvas was resized.
@memberOf module:webgl-utils
Resize a canvas to match the size its displayed .