docs: function scale(canvas, ctx, devicePixelRatio, backingStoreRatio) {
    var ratio;
    var oldWidth;
    var oldHeight;
  
    if (!canvas || canvas.tagName !== 'CANVAS') return;
    ctx = ctx || canvas.getContext('2d');
    devicePixelRatio = devicePixelRatio || devicePixelRatioTest;
    backingStoreRatio = backingStoreRatio || backingStoreRatioTest;
    oldWidth = canvas.width;
    oldHeight = canvas.height;
    ratio = devicePixelRatio / backingStoreRatio;
    canvas.width = oldWidth * ratio;
    canvas.height = oldHeight * ratio;
    canvas.style.width = oldWidth + 'px';
    canvas.style.height = oldHeight + 'px';
    ctx.scale(ratio, ratio);
  }