code: function updateCanvasSize(canvasInstance) {
  
      // apply scale factor for HDPI screens
      var scaleFactor = canvasInstance._HDPIscaleRatio;
  
      var width = canvasInstance._enqueuedSize.width,
          height = canvasInstance._enqueuedSize.height;
  
      canvasInstance._enqueuedSize = null;
  
      /** @protected @type {number} */canvasInstance._width = width;
      /** @protected @type {number} */canvasInstance._height = height;
  
      canvasInstance._element.width = width * scaleFactor;
      canvasInstance._element.height = height * scaleFactor;
  
      canvasInstance._element.style.width = width + "px";
      canvasInstance._element.style.height = height + "px";
  
      canvasInstance._canvasContext.scale(scaleFactor, scaleFactor);
  
      // non-smoothing must be re-applied when the canvas dimensions change...
  
      if (canvasInstance._smoothing === false) canvasInstance.setSmoothing(canvasInstance._smoothing);
  }
docs: /* internal methods 
  @private
  @param {Canvas} canvasInstance