code: function RenderLoop(stage) {
  
    var self = this;
  
    // The stage wrapped by the loop.
    this._stage = stage;
  
    // Whether the loop is running.
    this._running = false;
  
    // Whether the loop is currently rendering.
    this._rendering = false;
  
    // The current requestAnimationFrame handle.
    this._requestHandle = null;
  
    // The callback passed into requestAnimationFrame.
    this._boundLoop = this._loop.bind(this);
  
    // Handler for renderInvalid events emitted by the stage.
    this._renderInvalidHandler = function() {
      // If we are already rendering, there's no need to schedule a new render
      // on the next frame.
      if (!self._rendering) {
        self.renderOnNextFrame();
      }
    };
  
    // Handle renderInvalid events emitted by the stage.
    this._stage.addEventListener('renderInvalid', this._renderInvalidHandler);
  
  }
docs: Signals that {@link Stage#render} has just been called.
  @event RenderLoop#afterRender
   
  @class RenderLoop
  @classdesc
  
  A RenderLoop wraps a {@link Stage} and calls {@link Stage#render} on the next
  frame whenever it fires {@link Stage#renderInvalid}. It may be started and
  stopped, and is initially in the stopped state, in which no call to
  {@link Stage#render} occurs.
  
  @listens Stage#renderInvalid
  
  @param {Stage} stage