openlayers/ol3 — pull request #92 by twpayne (2013-01-03 17:13:27+00:00)
Title: Request render frame

This pull request adds the use of `requestAnimationFrame` during user interactions and tile loading.

Anybody can call `map.requestRenderFrame()` which will cause a render to occur on the next rAF callback, and any calls to `map.render()` will be ignored. When nobody has called `map.requestRenderFrame()`, `map.render()` renders immediately, as usual.

It's currently primarily used in two areas:

* Interactions call `requestRenderFrame` in their event handlers while they are active. This has the effect of batching updates and providing smooth interaction.

* Tile layer renderers call `requestRenderFrame` while they are waiting for tiles to load. This has the effect of batching renders on tile loads, removing the need for renderers to listen for tile change events.

With this patch, the frame rate is constant and high. Occasional frames are still dropped due to GC pauses, tile requests, image resizing, and texture uploads. These issues will be addressed in future pull requests.

Please test!