   # drawing
 
   draw: =>
+    return if @requestID?
+    requestFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame || window.webkitRequestAnimationFrame
+    if requestFrame?
+      @requestID = requestFrame @drawNow
+    else
+      @drawNow()
+
+  drawNow: =>
     @canvas.width = @canvas.width
     @updateCanvasSize()
     @updateMesh()

  tmpCtx: null

  blendFunction: null
  

  constructor: (params = {}) ->
    @images = []

        image.draw @tmpCtx, @mesh
        @blendFunction @ctx, @tmpCanvas, image.weight
      @trigger 'draw', this, @canvas
    @requestID = null

  updateCanvasSize: =>
    w = 0
