code: function _drawLayer($canvas, ctx, layer, nextLayerIndex) {
  	if (layer && layer.visible && layer._method) {
  		if (nextLayerIndex) {
  			layer._next = nextLayerIndex;
  		} else {
  			layer._next = null;
  		}
  		// If layer is an object, call its respective method
  		if (layer._method) {
  			layer._method.call($canvas, layer);
  		}
  	}
  }
docs: Draw individual layer (internal)