Move drawing loop into the request animation frame.