 
   ###
    * @param {Array} renderList
-   * @param {Function} setImmediate
+   * @param {Function} defer
   ###
-  constructor: (@plan, @setImmediate)->
+  constructor: (@plan, @defer)->
     @renderId = 0
     @ready = false
     @renderCtx =

      f(context2d, @renderCtx)
    return

  render: (context2d, cb)->
    unless @ready
      throw new Error('Painter not yet ready.')
    @rendering = true

        @renderId = 0
        @renderListPosition = 0
        @rendering = false
        @defer(cb)

      return
    enqueue(@renderId)
    return

window.Painter = Painter; 