createCanvas = function createCanvas(width, height, Canvas) {
    if (typeof document !== 'undefined') {
        var canvas = document.createElement('canvas');
        canvas.width = width;
        canvas.height = height;
        return canvas;
    } else {
        // create a new canvas instance in node.js
        // the canvas class needs to have a default constructor without any parameter
        return new Canvas(width, height);
    }
}
render layer
@param canvas
@param time
@returns {Layer}