Add preliminary Retina display support.

* Adapted from http://www.html5rocks.com/en/tutorials/canvas/hidpi/