Scale canvas by devicePixelRatio if it exists to support hi-dpi/retina screens
Prevent resizing from happening too often for performance reasons
Merge branch 'retina-canvas'